mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kai Ma <kai.ma1@huawei.com>
To: <paulmck@kernel.org>
Cc: Kai Ma <kai.ma1@huawei.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	<linux-kernel@vger.kernel.org>, "Boqun Feng" <boqun@kernel.org>,
	Bradley Morgan <brads@mainlining.org>,
	Gary Guo <gary@garyguo.net>, <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 0/4] Hazard pointer updates
Date: Tue, 27 Oct 2026 13:59:13 +0100	[thread overview]
Message-ID: <87zevz2tb2.fsf@huawei.com> (raw)
In-Reply-To: <e3b1c73d-8248-4644-80e7-a0640538fde6@paulmck-laptop>

"Paul E. McKenney" <paulmck@kernel.org> writes:

> On Mon, Oct 26, 2026 at 01:01:18PM +0100, Kai Ma wrote:
>> "Paul E. McKenney" <paulmck@kernel.org> writes:
>> 
>> > On Sun, Oct 11, 2026 at 03:48:46PM -0400, Mathieu Desnoyers wrote:
>> >> Hi Paul,
>> >> 
>> >> This series applies on top of "hazptr: handle NULL address in
>> >> hazptr_detach" you have in your rcu dev tree.
>> >> 
>> >> This first patch addresses a race identified by Boqun Feng in the
>> >> two-phase wildcard scheme. (no change since the last series)
>> >> 
>> >> Patches 2-3 are prerequisites for using ptr_eq() in the 4th patch.
>> >> Those were discussed at length in a prior version of hazard pointer
>> >> patches.
>> >> 
>> >> Since the last series, I have renamed ptreq.h to ptr_eq.h, addressing
>> >> the feedback received from Boqun and Gary.
>> >> 
>> >> Patch 4 introduces a "try acquire" helper to allow the fast path
>> >> to not rely on wildcards, while keeping the wildcard forward
>> >> progress guarantees in the acquire slow path, used on fast path
>> >> failure.
>> >
>> > I have pulled this in for additional review and testing, thank you!
>> > (With Bradley's Reviewed-by on 4/4.)  Still subject to rebase, which means
>> > that I can easily replace it with an updated series from you, if you
>> > wish.
>> 
>> Hi Paul, Mathieu, and everyone,
>> 
>> I've been following the hazard pointer work and have done some testing
>> on earlier versions. I'd be interested in getting more involved,
>> particularly in concurrency correctness testing.
>> 
>> If there are WIP patches or early design discussions where additional
>> review or testing would be useful, could you please CC me? I'd
>> appreciate the opportunity to get involved earlier and help identify
>> potential concurrency issues.
>
> The current stack is in my -rcu tree [1] at v7.3-rc1..c3aea7747975,
> with these patches on top:
>
> 5df49d76ff3a3 hazptr: Fix two-phase hazptr_synchronize race with detach
> b41c6c2d4a33f ptr_eq.h: Introduce ptr_eq() to preserve address dependency
> 97ff14db1c381 Documentation: RCU: Refer to ptr_eq()
> 451174c765179 hazptr: Introduce "try acquire" fast path, fallback to overflow list
> 633f91e3408cc hazptr: Record per-CPU slot owner after claiming the slot
>
> The biggest need is use cases, with the most likely ones being cases
> where per-CPU reference counts consume too much memory or a reference
> count is suffering from memory contention.  However, we are still finding
> critical bugs both in the mechanism and the torture tests, so as you say,
> review or testing is also very important.
>
> These patches CC the rcu@vger.kernel.org list, so the best way to get
> involved in the discussions is to join that list.
>
> And welcome aboard!!!

Thank you and also Bradley!

Kai

>
> 							Thanx, Paul
>
> [1] git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
>
>> Thanks,
>> Kai
>> 
>> > But in the meantime, some additional testing.  ;-)
>> >
>> > 							Thanx, Paul
>> >
>> >> Thanks,
>> >> 
>> >> Mathieu
>> >> 
>> >> Mathieu Desnoyers (4):
>> >>   hazptr: Fix two-phase hazptr_synchronize race with detach
>> >>   ptr_eq.h: Introduce ptr_eq() to preserve address dependency
>> >>   Documentation: RCU: Refer to ptr_eq()
>> >>   hazptr: Introduce "try acquire" fast path, fallback to overflow list
>> >> 
>> >> Cc: Paul E. McKenney <paulmck@kernel.org>
>> >> Cc: Boqun Feng <boqun@kernel.org>
>> >> Cc: Bradley Morgan <brads@mainlining.org>
>> >> Cc: Gary Guo <gary@garyguo.net>
>> >> Cc: <rcu@vger.kernel.org>
>> >> Cc: <lkmm@lists.linux.dev>
>> >> Cc: Lian Wang <lianux.mm@gmail.com>
>> >> Cc: Kunwu Chan <kunwu.chan@gmail.com>
>> >> 
>> >>  Documentation/RCU/rcu_dereference.rst |  38 +++++++-
>> >>  arch/x86/include/asm/ptr_eq.h         |  16 +++
>> >>  include/asm-generic/Kbuild            |   1 +
>> >>  include/asm-generic/ptr_eq.h          |  16 +++
>> >>  include/linux/hazptr.h                |  48 +++++----
>> >>  include/linux/ptr_eq.h                |  63 ++++++++++++
>> >>  kernel/hazptr.c                       | 135 +++++++++++++++-----------
>> >>  7 files changed, 237 insertions(+), 80 deletions(-)
>> >>  create mode 100644 arch/x86/include/asm/ptr_eq.h
>> >>  create mode 100644 include/asm-generic/ptr_eq.h
>> >>  create mode 100644 include/linux/ptr_eq.h
>> >> 
>> >> -- 
>> >> 2.43.0
>> >> 

      reply	other threads:[~2026-10-27 12:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 19:48 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-16  8:24   ` KunWu Chan
2026-10-16 13:41     ` Mathieu Desnoyers
2026-10-16 16:12       ` Paul E. McKenney
2026-10-11 19:48 ` [PATCH hazptr v3 2/4] ptr_eq.h: Introduce ptr_eq() to preserve address dependency Mathieu Desnoyers
2026-10-16  8:36   ` KunWu Chan
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
2026-10-11 20:10       ` Bradley Morgan
2026-10-16  9:05   ` KunWu Chan
2026-10-14 21:06 ` [PATCH hazptr v3 0/4] Hazard pointer updates Paul E. McKenney
2026-10-26 12:01   ` Kai Ma
2026-10-26 12:11     ` Bradley Morgan
2026-10-26 14:06     ` Paul E. McKenney
2026-10-27 12:59       ` Kai Ma [this message]

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=87zevz2tb2.fsf@huawei.com \
    --to=kai.ma1@huawei.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=mathieu.desnoyers@efficios.com \
    --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®