The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Leonardo Bras <leo.bras@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: Leonardo Bras <leo.bras@arm.com>,
	Oliver Upton <oupton@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Fuad Tabba <tabba@google.com>,
	Raghavendra Rao Ananta <rananta@google.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] KVM: arm64: Avoid re-testing walk_continue
Date: Wed,  8 Jul 2026 18:00:21 +0100	[thread overview]
Message-ID: <ak6CJWdhPaIYj2GU@LeoBrasDK> (raw)
In-Reply-To: <8733xt77tq.wl-maz@kernel.org>

On Wed, Jul 08, 2026 at 05:41:05PM +0100, Marc Zyngier wrote:
> On Wed, 08 Jul 2026 14:40:57 +0100,
> Leonardo Bras <leo.bras@arm.com> wrote:
> > 
> > In __kvm_pgtable_visit(), a couple tests for kvm_pgtable_walk_continue()
> > will 'goto out' if it should not continue. This means the same test will be
> > ran again before returning ret, which is unnecessary.
> > 
> > Return ret directly instead.
> > This will simplify next patch.
> 
> This reads quite badly, and doesn't explain what you are trying to do.
> How about something like:
> 
> "__kvm_pgtable_visit() performs a bunch of calls to
>  kvm_pgtable_walk_continue() to find out whether the walk can continue
>  further, and if not, falls back to an 'goto out' which retests the
>  possibility of continuing the walk.
> 
>  Given that there is no reason why the situation would have changed
>  between the two checks, turn this goto into an early return,
>  simplifying the code and paving the way for further rework."
> 

Agree, your version looks better.
Will try to be more clear, and reuse some of your version, in my next 
version.

Thanks!
Leo

  reply	other threads:[~2026-07-08 17:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 13:40 [PATCH v3 0/3] Optimize S2 page splitting Leonardo Bras
2026-07-08 13:40 ` [PATCH v3 1/3] KVM: arm64: Avoid re-testing walk_continue Leonardo Bras
2026-07-08 16:41   ` Marc Zyngier
2026-07-08 17:00     ` Leonardo Bras [this message]
2026-07-08 13:40 ` [PATCH v3 2/3] KVM: arm64: Introduce KVM_PGTABLE_WALK_SKIP_LEVEL* walk flags Leonardo Bras
2026-07-08 17:17   ` Marc Zyngier
2026-07-09 14:25     ` Leonardo Bras
2026-07-11  5:53   ` Wei-Lin Chang
2026-07-08 13:40 ` [PATCH v3 3/3] KVM: arm64: Make stage2_split_walker() skip unnecessary walks Leonardo Bras
2026-07-08 15:25 ` [PATCH v3 0/3] Optimize S2 page splitting Leonardo Bras

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=ak6CJWdhPaIYj2GU@LeoBrasDK \
    --to=leo.bras@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=rananta@google.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@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