mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH hazptr v2 0/4] Hazard pointer updates
@ 2026-10-09 18:21 Mathieu Desnoyers
  2026-10-09 18:21 ` [PATCH hazptr v2 1/4] hazptr: Fix two-phase hazptr_synchronize race with detach Mathieu Desnoyers
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mathieu Desnoyers @ 2026-10-09 18:21 UTC (permalink / raw)
  To: Paul E . McKenney
  Cc: linux-kernel, Mathieu Desnoyers, Boqun Feng, Bradley Morgan,
	Gary Guo, rcu, lkmm, Lian Wang, Kunwu Chan

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 modified patch 2 to take into account
feedback from Linus: There is now a x86-specific implementation of
ptr_eq, an asm-generic fallback, and both sit in newly introduced
"ptreq.h" headers.  The documentation is moved to linux/ptreq.h, which
includes asm/ptreq.h. This reuses all the usual mechanisms for
arch-specific implementation with asm-generic fallback.

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.

Thanks,

Mathieu

Mathieu Desnoyers (4):
  hazptr: Fix two-phase hazptr_synchronize race with detach
  ptreq.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/ptreq.h          |  16 +++
 include/asm-generic/Kbuild            |   1 +
 include/asm-generic/ptreq.h           |  16 +++
 include/linux/hazptr.h                |  48 +++++----
 include/linux/ptreq.h                 |  63 ++++++++++++
 kernel/hazptr.c                       | 135 +++++++++++++++-----------
 7 files changed, 237 insertions(+), 80 deletions(-)
 create mode 100644 arch/x86/include/asm/ptreq.h
 create mode 100644 include/asm-generic/ptreq.h
 create mode 100644 include/linux/ptreq.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-09 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 18:21 [PATCH hazptr v2 0/4] Hazard pointer updates Mathieu Desnoyers
2026-10-09 18:21 ` [PATCH hazptr v2 1/4] hazptr: Fix two-phase hazptr_synchronize race with detach Mathieu Desnoyers
2026-10-09 18:21 ` [PATCH hazptr v2 2/4] ptreq.h: Introduce ptr_eq() to preserve address dependency Mathieu Desnoyers
2026-10-09 19:03   ` Boqun Feng
2026-10-09 19:07     ` Mathieu Desnoyers
2026-10-09 21:55   ` Gary Guo
2026-10-09 18:21 ` [PATCH hazptr v2 3/4] Documentation: RCU: Refer to ptr_eq() Mathieu Desnoyers
2026-10-09 18:21 ` [PATCH hazptr v2 4/4] hazptr: Introduce "try acquire" fast path, fallback to overflow list Mathieu Desnoyers

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®