Skip to content

RFC sched+mm: Track lazy active mm existence with hazard pointers

Mathieu Desnoyers linux-doc linux-mm linuxppc-dev lkml lkmm llvm oe-lkp rcu 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest4 patches 3 repliesIn review
  2. v2 RFC4 patches 20 repliesSuperseded
  3. v1 RFC4 patches 19 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4compiler.h: Introduce ptr_eq() to preserve address dependencyinclude/linux/compiler.h+63 -00 replies
2/4Documentation: RCU: Refer to ptr_eq()Documentation/RCU/rcu_dereference.rst+33 -50 replies
3/4hazptr: Implement Hazard Pointersinclude/linux/hazptr.h kernel/Makefile kernel/hazptr.c+217 -11 reply
4/4sched+mm: Use hazard pointers to track lazy active mm existenceDocumentation/mm/active_mm.rst arch/Kconfig arch/powerpc/Kconfig +7 more+45 -1602 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchBoqun FengJoel Fernandes (Google)Paul E. McKenneyAlan Stern
1/4R-b R-b T-b A-b A-b
2/4R-b A-b A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [RFC PATCH v3 0/4] sched+mm: Track lazy active mm existence with hazard pointers

[
I'm posting a v3 taking care of feedback from Peter Zijlstra and Paul E. McKenney in case it can be useful to try hazard pointers with other use-cases, or for further benchmarking of active mm tracking impact.
]

Hazard pointers appear to be a good fit for replacing refcount based lazy active mm tracking.

Highlight:

will-it-scale context_switch1_threads

nr threads (-t) speedup

     1                -0.2%
     2                +0.4%
     3                +0.2%
     6                +0.6%
    12                +0.8%
    24                +3%
    48               +12%
    96               +21%
   192               +28%

384 +4%
768 -0.6%

This series applies on top of v6.11.1.

Cc Linus Torvalds <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc "Paul E. McKenney" <[email protected]>
Cc Will Deacon <[email protected]>
Cc Alan Stern <[email protected]>
Cc John Stultz <[email protected]>
Cc Neeraj Upadhyay <[email protected]>
Cc Boqun Feng <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Joel Fernandes <[email protected]>
Cc Josh Triplett <[email protected]>
Cc Uladzislau Rezki <[email protected]>
Cc Steven Rostedt <[email protected]>
Cc Lai Jiangshan <[email protected]>
Cc Zqiang <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Waiman Long <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Mateusz Guzik <[email protected]>
Cc Jonas Oberhauser <[email protected]>

Mathieu Desnoyers (4):
compiler.h: Introduce ptr_eq() to preserve address dependency
Documentation: RCU: Refer to ptr_eq()
hazptr: Implement Hazard Pointers
sched+mm: Use hazard pointers to track lazy active mm existence

 Documentation/RCU/rcu_dereference.rst |  38 +++++-
 Documentation/mm/active_mm.rst        |   9 +-
 arch/Kconfig                          |  32 -----
 arch/powerpc/Kconfig                  |   1 -
 arch/powerpc/mm/book3s64/radix_tlb.c  |  23 +---
 include/linux/compiler.h              |  63 ++++++++++
 include/linux/hazptr.h                | 165 ++++++++++++++++++++++++++
 include/linux/mm_types.h              |   3 -
 include/linux/sched/mm.h              |  68 ++++-------
 kernel/Makefile                       |   2 +-
 kernel/exit.c                         |   4 +-
 kernel/fork.c                         |  47 ++------
 kernel/hazptr.c                       |  51 ++++++++
 kernel/sched/sched.h                  |   8 +-
 lib/Kconfig.debug                     |  10 --
 15 files changed, 358 insertions(+), 166 deletions(-)
 create mode 100644 include/linux/hazptr.h
 create mode 100644 kernel/hazptr.c
Signature · 1 line
2.39.2