From: Marc Zyngier <maz@kernel.org>
To: Leonardo Bras <leo.bras@arm.com>
Cc: 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, 08 Jul 2026 17:41:05 +0100 [thread overview]
Message-ID: <8733xt77tq.wl-maz@kernel.org> (raw)
In-Reply-To: <20260708134101.2514759-2-leo.bras@arm.com>
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."
M.
--
Jazz isn't dead. It just smells funny.
next prev parent reply other threads:[~2026-07-08 16:39 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 [this message]
2026-07-08 17:00 ` Leonardo Bras
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=8733xt77tq.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=leo.bras@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.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