From: Hamza Mahfooz <someguy@effective-light.com>
To: Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86/mmu: move reused pages to the top of active_mmu_pages
Date: Fri, 23 Jan 2026 08:57:18 -0500 [thread overview]
Message-ID: <aXN-PsEU8jk7LEwh@hal-station.localdomain> (raw)
In-Reply-To: <aXLAfjpWwNLNv7pP@google.com>
On Thu, Jan 22, 2026 at 04:27:42PM -0800, Sean Christopherson wrote:
> Does this actually have a (positive) impact on real-world workloads? It seems
> like an obvious improvment, but there's enough subtlely around active_mmu_pages
> that I don't want to make any changes without a strong benefit.
>
My testing mostly focused on correctness, though I did see the fault rate
go down on a long running VM that I used to host a web server (I only
only gave it around a gig of RAM, so it is on the more extreme end).
> Specifically, kvm_zap_obsolete_pages() has a hard dependency on the list being
> FIFO. We _might_ be ok if we make sure to filter out obsolete pages, but only
> because of KVM's behavior of (a) only allowing two memslot generations at any
> given time and (b) zapping all shadow pages from the old/obsolete generation
> prior to kvm_zap_obsolete_pages() exiting.
for_each_valid_sp() already filters out obsolete pages, so we should be
good to go from that perspective.
> As alluded to above, I think I'd prefer to put this in kvm_mmu_find_shadow_page()?
> Largely a moot point, but it seems like we'd want to move a page to the head of
> the list if we look it up for any reason.
Sounds good to me, I put it in __kvm_mmu_get_shadow_page() since it seemed
clearer and it's currently the only caller of kvm_mmu_find_shadow_page().
prev parent reply other threads:[~2026-01-23 13:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 23:41 Hamza Mahfooz
2026-01-23 0:27 ` Sean Christopherson
2026-01-23 13:57 ` Hamza Mahfooz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXN-PsEU8jk7LEwh@hal-station.localdomain \
--to=someguy@effective-light.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®