[PATCH RFC v3 0/28] Simple hazard-pointer implementation and torture tests

From: Paul E. McKenney

Date: Fri Sep 18 2026 - 20:00:22 EST


Hello!

This series contains a simple hazard-pointer implementation and associated
torture tests:
1. Implement Hazard Pointers, courtesy of Mathieu Desnoyers.

2. Add refscale test, courtesy of Mathieu Desnoyers.

3. Add a hazptrtorture.c torture test.

4. Add testing of on-stack hazptr_ctx structures.

5. Add microsecond-scale sleep in readers.

6. Enable system-independent CPU overcommit.

7. Add a stutter_will_wait() function.

8. Use mnemonic local variables for context information.

9. Split hazptr_torture_reader_tail() from hazptr_torture_reader().

10. Add kthread to release deferred hazard pointers.

11. Defer release of hazard pointers.

12. Add irq_acquire to acquire hazptr from irq.

13. Use task_state_to_char() for task-state reporting, courtesy of
Kunwu Chan.

14. Pass hazptr_pending to hazptr_torture_reader_tail().

15. Add the ability to disable the writer kthread.

16. Add irq_release to release hazptr from irq.

17. Accumulate operation statistics.

18. Add hazptrtorture module parameters.

19. Permit detaching hazard pointers from contexts, courtesy of
Mathieu Desnoyers.

20. Detach deferred and IPIed hazard pointers, courtesy of Mathieu
Desnoyers.

21. Introduce CONFIG_HAZPTR_DEBUG misuse detection, courtesy of
Mathieu Desnoyers.

22. Fix hazptr ownership issue, courtesy of Mathieu Desnoyers.

23. Enable CONFIG_HAZPTR_DEBUG.

24. Upgrade kernel-doc headers.

25. Fix inverted sleep condition in do_pending kthread, courtesy of
Bradley Morgan.

26. Implement two-phase wildcard scan, courtesy of Mathieu Desnoyers.

27. handle NULL address in hazptr_detach, courtesy of Mathieu
Desnoyers.

28. torture.sh: Add hazptr torturing.

Thanx, Paul

Changes since RFC v2:

o Add bug-fix patches 25-27.

o Add patch 28 to automatically test hazptr from torture.sh.

o Apply tags.

Changes since RFC v1:

o Added a hazptr_detach() function to allow hazptr_acquire()
and the corresponding hazptr_release() to be in different
execution contexts.

o Torture testing of execution-context migration.

------------------------------------------------------------------------

b/Documentation/admin-guide/kernel-parameters.txt | 96 +
b/include/linux/hazptr.h | 197 ++
b/include/linux/torture.h | 2
b/init/main.c | 2
b/kernel/Makefile | 2
b/kernel/hazptr.c | 242 +++
b/kernel/rcu/Kconfig.debug | 12
b/kernel/rcu/Makefile | 1
b/kernel/rcu/hazptrtorture.c | 681 ++++++++++
b/kernel/rcu/refscale.c | 43
b/kernel/rcu/update.c | 3
b/kernel/sched/core.c | 2
b/kernel/torture.c | 23
b/tools/testing/selftests/rcutorture/bin/kvm.sh | 6
b/tools/testing/selftests/rcutorture/bin/torture.sh | 26
b/tools/testing/selftests/rcutorture/configs/hazptr/CFLIST | 2
b/tools/testing/selftests/rcutorture/configs/hazptr/CFcommon | 2
b/tools/testing/selftests/rcutorture/configs/hazptr/NOPREEMPT | 17
b/tools/testing/selftests/rcutorture/configs/hazptr/NOPREEMPT.boot | 1
b/tools/testing/selftests/rcutorture/configs/hazptr/PREEMPT | 14
b/tools/testing/selftests/rcutorture/configs/hazptr/ver_functions.sh | 40
include/linux/hazptr.h | 190 ++
include/linux/torture.h | 4
kernel/hazptr.c | 98 +
kernel/rcu/Kconfig.debug | 14
kernel/rcu/hazptrtorture.c | 423 +++++-
kernel/torture.c | 15
tools/testing/selftests/rcutorture/bin/kvm.sh | 4
tools/testing/selftests/rcutorture/configs/hazptr/NOPREEMPT | 2
tools/testing/selftests/rcutorture/configs/hazptr/PREEMPT | 2
30 files changed, 2019 insertions(+), 147 deletions(-)