Skip to content

rcu: simplify rcu_barrier() interaction with CPU hotplug

Paul E. McKenney lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3rcu: replace the rcu_barrier enum with pointer to call_rcu*() functionkernel/rcupdate.c+10 -222 replies
2/3rcu: move rcu_barrier() to rcutree, make lightweight rcu_barrier() for rcutinykernel/rcupdate.c kernel/rcutiny.c kernel/rcutree.c+156 -1192 replies
3/3rcu: make hot-unplugged CPU relinquish its own RCU callbackskernel/rcutree.c kernel/rcutree.h kernel/rcutree_plugin.h +1 more+125 -752 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMathieu Desnoyers
1/3A-b A-b
2/3A-b A-b
3/3A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH tip/core/rcu 0/3] rcu: simplify rcu_barrier() interaction with CPU hotplug

This patchset simplifies the interaction of rcu_barrier() with CPU hotplug operations. The main point of this patchset is to impose an
invariant: offline CPUs never have any RCU callbacks queued. However, rcutiny doesn't permit CPU hotplug (yes, I have worked in environments where the last CPU could be offlined, but Linux is thankfully not one of them), so the patchset goes as follows:

o Replace the rcu_barrier enum with a pointer to the relevant
call_rcu() function, thus eliminating any confusion about which .h file this enum should reside in.

o Move the rcu_barrier() code to rcutree, and create a lightweight
variant of rcu_barrier() that is suitable for rcutiny. This lightweight variant is identical to rcutree's implementation of synchronize_rcu() and friends.

o Create a list in the rcu_state structure that holds RCU
callbacks that were "orphaned" by CPUs that just went offline. The CPU_DYING notifier moves all RCU callbacks from the outgoing CPU to the rcu_state lists, and the CPU_DEAD notifier and _rcu_barrier() function "adopt" these orphans.

 b/kernel/rcupdate.c       |   33 +++-------
 b/kernel/rcutiny.c        |   36 ++++++++++
 b/kernel/rcutree.c        |  120 ++++++++++++++++++++++++++++++++++++
 b/kernel/rcutree.h        |   11 +++
 b/kernel/rcutree_plugin.h |   34 ++++++++++
 b/kernel/rcutree_trace.c  |    5 -
 kernel/rcupdate.c         |  120 ------------------------------------
 kernel/rcutree.c          |  151 ++++++++++++++++++++++++----------------------
 8 files changed, 291 insertions(+), 219 deletions(-)