From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Boqun Feng <boqun@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Kunwu Chan <kunwu.chan@gmail.com>,
paulmck@kernel.org, corbet@lwn.net, mingo@redhat.com,
frederic@kernel.org, neeraj.upadhyay@kernel.org,
josh@joshtriplett.org, urezki@gmail.com, dave@stgolabs.net,
lianux.mm@gmail.com, stern@rowland.harvard.edu,
parri.andrea@gmail.com, will@kernel.org, peterz@infradead.org,
npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk,
luc.maranget@inria.fr, akiyks@gmail.com, dlustig@nvidia.com,
joelagnelf@nvidia.com, skhan@linuxfoundation.org,
rdunlap@infradead.org, longman@redhat.com, rostedt@goodmis.org,
qiang.zhang@linux.dev, brads@mainlining.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
lkmm@lists.linux.dev, linux-doc@vger.kernel.org,
rcu@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH RFC v3 08/15] locking/lockdep: use hazptr to wait for dynamic key lookups
Date: Tue, 13 Oct 2026 09:04:50 -0400 [thread overview]
Message-ID: <ef3fd68d-f35e-4071-9523-0cd14396d860@efficios.com> (raw)
In-Reply-To: <as4ooZSWA2lAIceu@tardis.local>
On 2026-10-13 08:48, Boqun Feng wrote:
> On Tue, Oct 13, 2026 at 03:40:36PM +0800, Lai Jiangshan wrote:
[...]
>>
>> This breaks the forward-progress argument used by the underlying
>> hazptr implementation: after removing an object from publication,
>> there should not be a continuing stream of new readers acquiring
>> that same object. Here, the bucket is never unpublished.
>>
>> For example, let B be the bucket containing key K:
>>
>> Updater Reader Scan kthread
>> ------- ------ ------------
>> Unlink K from B
>> hazptr_synchronize(B)
>> Acquire B
>> Observe B;
>> retain waiter
>> Release B
>> Acquire B again
>> Observe B;
>> retain waiter
>> Release B
>> ... ...
>>
>
> This is more of an implementation issue,
I agree with Boqun about the point that this is really an implementation
issue.
If we care about forward progress in the scenario of a repeated
address reuse, we just need to wire up a "0/1" low bit phase tag and
make hazptr acquire pick it up and set it within its hazptr slot. This
will ensure forward progress in that scenario. hazptr synchronzie
would therefore flip this phase between 0 and 1, and check that the
pointer it's looking for is not set in the other phase, in alternance,
handling both phases within one synchronize. Indeed, this phase concept
comes from the realm of RCU implementations.
I think that the overall mindset so far has been "RCU does this" and
"Hazard pointers do this" as if those were entirely predefined
mechanisms. I think the way forward is not "one or the other", but
rather to combine the strengths of each of those mechanisms into
something better.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
next prev parent reply other threads:[~2026-10-13 13:04 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 17:15 [PATCH RFC v3 00/15] hazptr: batch synchronize operations through a shared scan Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 01/15] hazptr: add shared scan kthread Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 02/15] hazptr: use Bloom filter for shared scan waiters Kunwu Chan
2026-10-06 5:51 ` Mathieu Desnoyers
2026-10-06 6:13 ` KunWu Chan
2026-10-10 3:06 ` KunWu Chan
2026-10-05 17:15 ` [PATCH RFC v3 03/15] hazptr: scan all per-CPU slots before overflow lists Kunwu Chan
2026-10-13 11:26 ` Kai Ma
2026-10-05 17:15 ` [PATCH RFC v3 04/15] hazptr: add scoped_guard() support Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 05/15] hazptr: add debug option to force the acquire slow path Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 06/15] hazptr: elide redundant first drain pass Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 07/15] Documentation/litmus-tests: add hazptr wildcard-flip escape test Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 08/15] locking/lockdep: use hazptr to wait for dynamic key lookups Kunwu Chan
2026-10-13 7:40 ` Lai Jiangshan
2026-10-13 12:48 ` Boqun Feng
2026-10-13 13:04 ` Mathieu Desnoyers [this message]
2026-10-13 14:05 ` Lai Jiangshan
2026-10-13 18:55 ` Paul E. McKenney
2026-10-05 17:15 ` [PATCH RFC v3 09/15] rcuscale: add hazptr scale type Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 10/15] hazptr: fix kernel-doc of hazptr_release() Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 11/15] Documentation/litmus-tests: add hazptr acquire-before-scan test Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 12/15] hazptrtorture: add slowpath and lockdep scenarios Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 13/15] hazptrtorture: add READERS4 and READERS0 torture configs Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 14/15] hazptrtorture: add 128- and 256-CPU configs Kunwu Chan
2026-10-05 17:15 ` [PATCH RFC v3 15/15] selftests/rcutorture: add hazptr torture test script Kunwu Chan
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=ef3fd68d-f35e-4071-9523-0cd14396d860@efficios.com \
--to=mathieu.desnoyers@efficios.com \
--cc=akiyks@gmail.com \
--cc=boqun@kernel.org \
--cc=brads@mainlining.org \
--cc=corbet@lwn.net \
--cc=dave@stgolabs.net \
--cc=dhowells@redhat.com \
--cc=dlustig@nvidia.com \
--cc=frederic@kernel.org \
--cc=j.alglave@ucl.ac.uk \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=kunwu.chan@gmail.com \
--cc=lianux.mm@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lkmm@lists.linux.dev \
--cc=longman@redhat.com \
--cc=luc.maranget@inria.fr \
--cc=mingo@redhat.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=npiggin@gmail.com \
--cc=parri.andrea@gmail.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=stern@rowland.harvard.edu \
--cc=urezki@gmail.com \
--cc=will@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®