Skip to content

Remove scheduler restriction, update for v5.8

Paul E. McKenney lkml rcu 1 version New

Get series with b4
b4 am 20200415175543.GA10416@paulmck-ThinkPad-P72

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6rcu: Add KCSAN stubs to update.ckernel/rcu/update.c+13 -00 replies
2/6rcu: Make rcu_read_unlock_special() safe for rq/pi lockskernel/rcu/tree_plugin.h+8 -90 replies
3/6rcu: Don't set nesting depth negative in rcu_preempt_deferred_qs()kernel/rcu/tree_plugin.h+0 -50 replies
4/6rcu: Remove unused ->rcu_read_unlock_special.b.deferred_qs fieldinclude/linux/sched.h kernel/rcu/tree_plugin.h+1 -20 replies
5/6rcu: Don't use negative nesting depth in __rcu_read_unlock()kernel/rcu/tree_exp.h kernel/rcu/tree_plugin.h+12 -410 replies
6/6rcutorture: Add test of holding scheduler locks across rcu_read_unlock()kernel/rcu/rcutorture.c+9 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH tip/core/rcu 0/6] Remove scheduler restriction, update for v5.8

Hello!

This series removes the long-standing restriction preventing holding of scheduler locks across rcu_read_unlock() unless interrupts have been disabled across the entire RCU read-side critical section.

For example, with this series, the following code is now perfectly legal, and is in fact tested by rcutorture:

	// Preemption is enabled.
	rcu_read_lock();
	do_something();
	raw_spin_lock_irqsave(&current->pi_lock, flags);
	rcu_read_unlock();
	raw_spin_unlock_irqrestore(&current->pi_lock, flags);

This change was enabled by the earlier changes that turn on scheduler-clock interrupts for nohz_full CPUs that take too long to report a quiescent state during a given grace period. (Yes, nohz_full CPUs executing in userspace still have their quiescent states implicitly reported by the RCU grace-period kthread!)

And here is the series:

1. Add KCSAN stubs to update.c.

2. Make rcu_read_unlock_special() safe for rq/pi locks.

3. Don't set nesting depth negative in rcu_preempt_deferred_qs(),
courtesy of Lai Jiangshan.

4. Remove unused ->rcu_read_unlock_special.b.deferred_qs field,
courtesy of Lai Jiangshan.

5. Don't use negative nesting depth in __rcu_read_unlock(),
courtesy of Lai Jiangshan.

6. Add test of holding scheduler locks across rcu_read_unlock().

Thanx, Paul

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

 include/linux/sched.h    |    2 +-
 kernel/rcu/rcutorture.c  |   10 +++++++++-
 kernel/rcu/tree_exp.h    |   31 +++++--------------------------
 kernel/rcu/tree_plugin.h |   45 +++++++++++++++------------------------------
 kernel/rcu/update.c      |   13 +++++++++++++
 5 files changed, 43 insertions(+), 58 deletions(-)