All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sean Christopherson" <seanjc@google.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: x86/mmu: Expose number of shadow MMU shadow pages as a stat
Date: Fri, 05 Jun 2026 18:06:16 +0000	[thread overview]
Message-ID: <20260605180617.5B4B01F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260605174611.2222504-3-seanjc@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The field `n_used_mmu_pages` was not removed from `struct kvm_arch`, leaving unused dead code.
--

commit 5fa7e390c84e0ce29ce7989e7bf60ba442c4e942
Author: Sean Christopherson <seanjc@google.com>

KVM: x86/mmu: Expose number of shadow MMU shadow pages as a stat

Turn arch.n_used_mmu_pages into a stat, mmu_shadow_pages, as the number of
live shadow pages is arguably the most critical datapoint when it comes
to analyzing the shadow MMU. 

> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 3886b536c8a57..be84e4d2405e0 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1701,6 +1701,7 @@ struct kvm_vm_stat {
>  	u64 mmu_recycled;
>  	u64 mmu_cache_miss;
>  	u64 mmu_unsync;
> +	u64 mmu_shadow_pages;
>  	union {
>  		struct {
>  			atomic64_t pages_4k;

[Severity: Low]
Should n_used_mmu_pages be removed from struct kvm_arch in this file?

Since all usages of kvm->arch.n_used_mmu_pages are replaced by
kvm->stat.mmu_shadow_pages in this patch, it appears the original
declaration is left behind as unused dead code:

arch/x86/include/asm/kvm_host.h:
struct kvm_arch {
	unsigned long n_used_mmu_pages;
	...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260605174611.2222504-1-seanjc@google.com?part=2

  reply	other threads:[~2026-06-05 18:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05 17:46 [PATCH 0/2] KVM: x86/mmu: Plug an unsync shadow page leak Sean Christopherson
2026-06-05 17:46 ` [PATCH 1/2] KVM: x86/mmu: Recursively zap orphaned nested TDP shadow pages on emulated writes Sean Christopherson
2026-06-06 13:04   ` Jim Mattson
2026-06-05 17:46 ` [PATCH 2/2] KVM: x86/mmu: Expose number of shadow MMU shadow pages as a stat Sean Christopherson
2026-06-05 18:06   ` sashiko-bot [this message]
2026-06-05 18:14     ` Sean Christopherson

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=20260605180617.5B4B01F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=seanjc@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.