Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Vincent Donnefort <vdonnefort@google.com>
Cc: oupton@kernel.org, kvmarm@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org, joey.gouly@arm.com,
	seiden@linux.ibm.com, suzuki.poulose@arm.com,
	yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
	kernel-team@android.com, fuad.tabba@linux.dev, ljs@kernel.org,
	ryan.roberts@arm.com
Subject: Re: [PATCH v1] KVM: arm64: Fast path transparent_hugepage_adjust() for non-PMD folios
Date: Tue, 03 Nov 2026 08:22:47 +0000	[thread overview]
Message-ID: <867biu2ujs.wl-maz@kernel.org> (raw)
In-Reply-To: <20261102211900.504192-1-vdonnefort@google.com>

On Mon, 02 Nov 2026 21:19:00 +0000,
Vincent Donnefort <vdonnefort@google.com> wrote:
> 
> transparent_hugepage_adjust() must walk the userspace stage-1 to detect
> if a PMD-level mapping is installed. If it is, then a stage-2 block
> mapping can be installed. Even though this stage-1 walk is most likely
> cache hot (in most cases, the mapping has just been installed), walking
> a page-table is still costly. This walks accounts for ~5% of the
> user_mem_abort() execution time on an Apple M2 big core. This makes a
> fast path interesting.

This raises a few questions:

- Isn't this a "fast fail" rather than a fast path? You don't make the
  S1 walk faster, but you instead avoid cases where it would have
  returned an level-3 size.

  If anything, you make transparent_hugepage_adjust() slower for the
  case that succeeds. I don't think this invalidates the approach, but
  it feels that the commit message is just wrong.

- How do you measure this? 5% feels like a huge amount for something
  that should be 3 loads. Isn't this more an indication that the page
  table walker is overly complicated because it was designed for
  something else? In any case, It'd be good to verify your findings,
  so please provide a minimal reproducer.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2026-11-03  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 21:19 [PATCH v1] KVM: arm64: Fast path transparent_hugepage_adjust() for non-PMD folios Vincent Donnefort
2026-11-03  8:22 ` Marc Zyngier [this message]
2026-11-03 14:26   ` Vincent Donnefort

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=867biu2ujs.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=ljs@kernel.org \
    --cc=oupton@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vdonnefort@google.com \
    --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