From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Bradley Morgan <brads@mainlining.org>,
"Paul E . McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org, Gary Guo <gary@garyguo.net>,
Boqun Feng <boqun@kernel.org>,
rcu@vger.kernel.org, lkmm@lists.linux.dev,
Lian Wang <lianux.mm@gmail.com>,
Kunwu Chan <kunwu.chan@gmail.com>
Subject: Re: [PATCH hazptr v3 4/4] hazptr: Introduce "try acquire" fast path, fallback to overflow list
Date: Sun, 11 Oct 2026 16:06:24 -0400 [thread overview]
Message-ID: <97f91313-e629-40c0-b3ff-f23c235a8ad8@efficios.com> (raw)
In-Reply-To: <E99B2D1B-6D27-4ED7-A7A4-083DB5427925@mainlining.org>
On 2026-10-11 15:59, Bradley Morgan wrote:
> On 11 October 2026 20:48:50 BST, Mathieu Desnoyers
> <mathieu.desnoyers@efficios.com> wrote:
>> Introduce a "try acquire" hazard pointer fast path, which performs an
>> early load of the address to store it into the hazard pointer slot, and
>> then re-loads that address after a barrier to check whether it has
>> changed meanwhile.
>>
>> On comparison failure, rather than re-try, guarantee forward progress by
>> falling back to the __hazptr_acquire slow path on failure.
>>
>> The acquire slow path attempts a try-acquire for any available per-CPU
>> slot. If that fails, it chains the backup slot into the overflow list,
>> therefore guaranteeing forward progress for both hazard pointer
>> read-side and synchronize:
>>
>> - Readers set the wildcard, and then proceed to set the more
>> specific address to replace the wildcard.
>>
>> - One synchronize alternates between two overflow list periods,
>> scanning each one while readers are added to the other period,
>> thus preventing a steady flow of readers from preventing
>> synchronize forward progress.
>>
>> With this change, the scan on per-CPU slots don't need to expect a
>> wildcard anymore, because none can be produced by readers. Wildcards are
>> only expected within overflow lists.
>>
>> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>> Suggested-by: Gary Guo <gary@garyguo.net>
>> Link: https://lore.kernel.org/lkmm/DLK9MW1N86KD.2GRWUAD2NX4FU@garyguo.net/
>> Reviewed-by: Gary Guo <gary@garyguo.net>
>
> Hi, my R-B still stands from
>
> https://lore.kernel.org/all/C53DEBF5-555F-44A8-A11C-A15C83AAD341@mainlining.org/
>
> Reviewed-by: Bradley Morgan <brads@mainlining.org>
Sorry, I forgot to add it to my commit message. I'll add it to the next
round (if there is one), else hopefully Paul can add the R-B tag if he
picks up this series.
Thanks!
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2026-10-11 20:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 19:48 [PATCH hazptr v3 0/4] Hazard pointer updates Mathieu Desnoyers
2026-10-11 19:48 ` [PATCH hazptr v3 1/4] hazptr: Fix two-phase hazptr_synchronize race with detach Mathieu Desnoyers
2026-10-11 19:48 ` [PATCH hazptr v3 2/4] ptr_eq.h: Introduce ptr_eq() to preserve address dependency Mathieu Desnoyers
2026-10-11 19:48 ` [PATCH hazptr v3 3/4] Documentation: RCU: Refer to ptr_eq() Mathieu Desnoyers
2026-10-11 19:48 ` [PATCH hazptr v3 4/4] hazptr: Introduce "try acquire" fast path, fallback to overflow list Mathieu Desnoyers
2026-10-11 19:59 ` Bradley Morgan
2026-10-11 20:06 ` Mathieu Desnoyers [this message]
2026-10-11 20:10 ` Bradley Morgan
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=97f91313-e629-40c0-b3ff-f23c235a8ad8@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=boqun@kernel.org \
--cc=brads@mainlining.org \
--cc=gary@garyguo.net \
--cc=kunwu.chan@gmail.com \
--cc=lianux.mm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkmm@lists.linux.dev \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
/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®