From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Marc Zyngier <maz@kernel.org>
Cc: Usama Arif <usama.arif@linux.dev>,
oupton@kernel.org, fuad.tabba@linux.dev, joey.gouly@arm.com,
seiden@linux.ibm.com, suzuki.poulose@arm.com,
yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
mark.rutland@arm.com, kvmarm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, riel@surriel.com,
shakeel.butt@linux.dev, kernel-team@meta.com, rkeilty@meta.com,
atish.patra@linux.dev, dgreid@meta.com
Subject: Re: [PATCH] KVM: arm64: Reduce the stage-2 page cache on 64 KiB hosts
Date: Thu, 26 Nov 2026 16:52:48 +0000 [thread overview]
Message-ID: <awhij_-9OARRRi9D@gremlin> (raw)
In-Reply-To: <86v75jy48c.wl-maz@kernel.org>
On Thu, Nov 26, 2026 at 03:58:11PM +0000, Marc Zyngier wrote:
> On Thu, 26 Nov 2026 14:32:04 +0000,
> Usama Arif <usama.arif@linux.dev> wrote:
>
> [nonsense deleted]
>
> > > Now, to the patch itself: I see no reason to special-case this. If
> > > kvm_mmu_cache_min_pages() is an indication of what is needed, then
> > > this macro should be driven by it, or the whole allocator take it into
> > > account. And then you adjust it by whatever fudge factor seems
> > > appropriate.
> > >
> >
> > Completely agree! [1] does that: no page-size special case, and
> > a capacity of KVM_PGTABLE_LAST_LEVEL - KVM_PGTABLE_FIRST_LEVEL for every
> > page size. It can't track kvm_mmu_cache_min_pages()
> > at runtime: the vCPU's cache is shared by the canonical and NV shadow
> > MMUs, and its capacity must stay fixed. So it has to cover the largest
> > minimum, which stage-2 caps at 3, and 4 is that plus one page of fudge.
>
> Of course it can. That's not exactly rock science to add, rather than
> relying on another set of bad heuristics. And this must cover more
> than a single mapping per top-up, because that has a ripple effect on
> the speed at which we can split large blocks (funnily enough, people
> care about that stuff).
Hmm is splitting a factor here re: the cache?
In kvm_mmu_split_huge_pages() it is using kvm->arch.mmu.split_page_cache which
is a separate cache altogether right?
And splitting on fault is via e.g. kvm_vm_mem_abort() -> user_mem_abort() which
tops up anyway? (Minus an NV case which is a bug I think, I can send that as a
patch separately? I mention in another reply.)
Maybe I missed a case?
Re: the speed, having bigger cache size doesn't speed anything up as the refill
refills to the max each time, so you're doing the same # of allocations, just
maybe with a much bigger latency on one fault (seems bad to me)?
>
> M.
>
> --
> Without deviation from the norm, progress is not possible.
>
--
Cheers, Lorenzo
prev parent reply other threads:[~2026-11-26 16:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 15:28 Usama Arif
2026-11-25 17:14 ` Leonardo Bras
2026-11-25 17:55 ` Usama Arif
2026-11-25 18:25 ` Leonardo Bras
2026-11-25 21:42 ` Usama Arif
2026-11-26 8:06 ` Wei-Lin Chang
2026-11-26 15:19 ` Leonardo Bras
2026-11-26 15:34 ` Wei-Lin Chang
2026-11-26 15:55 ` Leonardo Bras
2026-11-26 16:45 ` Lorenzo Stoakes (ARM)
2026-11-26 17:07 ` Leonardo Bras
2026-11-26 17:18 ` Lorenzo Stoakes (ARM)
2026-11-26 17:44 ` Leonardo Bras
2026-11-26 16:30 ` Lorenzo Stoakes (ARM)
2026-11-26 16:53 ` Lorenzo Stoakes (ARM)
2026-11-26 18:25 ` Leonardo Bras
2026-11-26 12:56 ` Marc Zyngier
2026-11-26 14:32 ` Usama Arif
2026-11-26 15:58 ` Marc Zyngier
2026-11-26 16:52 ` Lorenzo Stoakes (ARM) [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=awhij_-9OARRRi9D@gremlin \
--to=ljs@kernel.org \
--cc=atish.patra@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=dgreid@meta.com \
--cc=fuad.tabba@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kernel-team@meta.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=riel@surriel.com \
--cc=rkeilty@meta.com \
--cc=seiden@linux.ibm.com \
--cc=shakeel.butt@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=usama.arif@linux.dev \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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 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®