From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 734C914AD24 for ; Wed, 25 Sep 2024 23:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727308488; cv=none; b=pkX/P9nu4vXJet9uNUZxjQX6hFBmioXZRHBBA0ZliTvxPbGNz1pR4IBpeoQ7UThu+W6GlxCfK1X8KwJ9XK5U1RhvMJh/MyBijsTawrElGRz0S7EqUDjY1SYRTteZ0UnwQcTHKOPFZWsFMxxIPVgGMd4N9NSn8rdNokoUzkskWQ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727308488; c=relaxed/simple; bh=gOwSyLGNGcndIHcc19zgCHlgwnw0OJizgjnZ1/eV1cM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bfs1acPbc9NB6mPbK0YnRts5tpWFo/DWKupnrB3/k+0jzo8hEIkZisrdEAs8Kt4Bt4r40ihwiTsMWoEQS0kEkEDyfc6BgwWGgejwqYykIO8BOFAbq627lnMIs6hnk++cskME0ADYrZT5GAJGGni9duz4iqKJc0qE4WFeAQjnih4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IZ6BqOSy; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IZ6BqOSy" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2d8a54f1250so349233a91.0 for ; Wed, 25 Sep 2024 16:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1727308487; x=1727913287; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BPIrG48JYLdoIFjq+YQPVxvOebeKVybr78OCt6RYK3Y=; b=IZ6BqOSyEWoe2XWfiVxXD+u5O6+ndK1OTXRv1RB0b3SP3hgFOojNGegNcOusUtQBn4 2UZLFwqiPg3ROq8lhMYPPfIa6ZQ34Yn0REUHrA4pSjEB3AcjOrVzO1JDVidpRtTGtQRq NZ+1lrwtr0VMDmPAwPoj04MhoZ3DyIMwgTNrbnAxK80aDiE7auMjXlG0cUGt6r9IJrld A6iCfjQS8gMvAhsyfLgy6SXHP3E0n1avwYZc1zlSpZO9n3qeD/0wUaBpoZwRjRvKc/Uz CTspf8ffevQU7EuFcye1WSwUZF5fgu2Hket9XgCe3MUOQwv6uXMwZK4/msgudYD+SuMB D2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727308487; x=1727913287; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BPIrG48JYLdoIFjq+YQPVxvOebeKVybr78OCt6RYK3Y=; b=q0MgbIkKhwsg5lNRYsaxHuqW2EiA0C+/lubYaTcQOqzO7emJ3s6nBX2/zGOqAvMeeQ fZKHCsg4b9M2bqVWVlNtZBBjdBDwGBxna7nAhv8P3oV6VPImsXazrFxPnDKJuWh8UPO0 P+MiaG+ThVkbm8V4+M7xcQlcqkVjOxkOAG5j4riqxGzToLyhfaRIuLeAfsDcA1/Ul7k3 58uTa0xgwVBChsFKok5mXKiB4cD7RcFxvY/MpsWnYXxyZEZvuh5TXNTApid1v3SHoNW2 nwNgRqBydaaNfPHJSl7f6anCzYnndQG/hOkIkm9AJ/M0q0FpEJq/OUUi5IJOjbIiaQWP 6NFg== X-Forwarded-Encrypted: i=1; AJvYcCX3f2onLL3/HyA3jREZWpC7kIePtgTI1IVuq0b4IxUJvpiSqkTkWR3gUzSlxd/5QdWRkIefLWCCXbujA9Y=@vger.kernel.org X-Gm-Message-State: AOJu0YwRcnClmmO+cfvtR02/YhTJ4j9/IJUP8rHcmCFddhsQRXOI1Lln QFDkopg0+2wLcxlVvTCENh6Z37sHq3DcnQL5FZFGMGXvb2d76v8/ekAadvG/hA== X-Google-Smtp-Source: AGHT+IGcE3X6C1/MkwIoK7n5+4anKnUm5PMfHFhhK0bQSFUAAbP5pQ+ofyEhXIkKahGjfUidMIedkA== X-Received: by 2002:a17:90b:1c11:b0:2d3:d728:6ebb with SMTP id 98e67ed59e1d1-2e06ae21775mr4852142a91.5.1727308486443; Wed, 25 Sep 2024 16:54:46 -0700 (PDT) Received: from google.com (46.242.125.34.bc.googleusercontent.com. [34.125.242.46]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e06e1b8e25sm2063439a91.13.2024.09.25.16.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 16:54:45 -0700 (PDT) Date: Wed, 25 Sep 2024 16:54:41 -0700 From: David Matlack To: Vipin Sharma Cc: seanjc@google.com, pbonzini@redhat.com, zhi.wang.linux@gmail.com, weijiang.yang@intel.com, mizhang@google.com, liangchen.linux@gmail.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] KVM: x86/mmu: Change KVM mmu shrinker to no-op Message-ID: References: <20240913214316.1945951-1-vipinsh@google.com> <20240913214316.1945951-2-vipinsh@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240913214316.1945951-2-vipinsh@google.com> On 2024-09-13 02:43 PM, Vipin Sharma wrote: > Remove global kvm_total_used_mmu_pages and page zapping flow from MMU > shrinker. Keep shrinker infrastructure in place to reuse in future > commits for freeing KVM page caches. Remove zapped_obsolete_pages list > from struct kvm_arch{} and use local list in kvm_zap_obsolete_pages() > since MMU shrinker is not using it anymore. > > mmu_shrink_scan() is very disruptive to VMs. It picks the first VM in > the vm_list, zaps the oldest page which is most likely an upper level > SPTEs and most like to be reused. Prior to TDP MMU, this is even more > disruptive in nested VMs case, considering L1 SPTEs will be the oldest > even though most of the entries are for L2 SPTEs. > > As discussed in > https://lore.kernel.org/lkml/Y45dldZnI6OIf+a5@google.com/ shrinker logic > has not be very useful in actually keeping VMs performant and reducing > memory usage. > > Suggested-by: Sean Christopherson > Suggested-by: David Matlack > Signed-off-by: Vipin Sharma > --- Reviewed-by: David Matlack