Skip to content

RFC rcu: simplify race conditions, add checking

Paul E. McKenney lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest18 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18rcu: adjust force_quiescent_state() locking, step 1kernel/rcutree.c+18 -90 replies
2/18rcu: adjust force_quiescent_state() locking, step 2kernel/rcutree.c+3 -100 replies
3/18rcu: prohibit starting new grace periods while forcing quiescent stateskernel/rcutree.c kernel/rcutree.h+19 -140 replies
4/18rcu: eliminate local variable signaled from force_quiescent_state()kernel/rcutree.c+3 -60 replies
5/18rcu: eliminate local variable lastcomp from force_quiescent_state()kernel/rcutree.c kernel/rcutree.h+3 -90 replies
6/18rcu: eliminate second argument of rcu_process_dyntick()kernel/rcutree.c+5 -60 replies
7/18rcu: eliminate rcu_process_dyntick() return valuekernel/rcutree.c+6 -110 replies
8/18rcu: remove leg of force_quiescent_state() switch statementkernel/rcutree.c kernel/rcutree.h+7 -200 replies
9/18rcu: remove redundant grace-period checkkernel/rcutree.c+4 -50 replies
10/18rcu: make force_quiescent_state() start grace period if neededkernel/rcutree.c kernel/rcutree.h+13 -00 replies
11/18rcu: add force_quiescent_state() testing to rcutortureinclude/linux/rcutiny.h include/linux/rcutree.h kernel/rcutorture.c +2 more+130 -20 replies
12/18rcu: make MAINTAINERS file match new RCU realityMAINTAINERS+7 -61 reply
13/18rcu: add debug check for too many rcu_read_unlock()kernel/rcutree_plugin.h+3 -00 replies
14/18rcu: lockdep check for exiting to user space as RCU readerinclude/linux/rcutiny.h include/linux/rcutree.h kernel/lockdep.c +1 more+37 -02 replies
15/18rcu: give different levels of the rcu_node hierarchy distinct lockdep nameskernel/rcutree.c+8 -15 replies
16/18rcu: make lockdep aware of SRCU read-side critical sections.include/linux/srcu.h kernel/srcu.c+55 -150 replies
17/18rcu: Provide different lockdep classes for each flavor of RCUinclude/linux/rcupdate.h kernel/rcupdate.c+39 -100 replies
18/18rcu: add primitives to check for RCU read-side critical sectionsinclude/linux/rcupdate.h include/linux/rcutiny.h include/linux/rcutree.h +4 more+120 -294 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH RFC tip/core/rcu 0/18] rcu: simplify race conditions, add checking

Hello!

This is just a sneak preview of RCU patches that I have in flight, not yet for inclusion.

Patches 1-10 simplify TREE_RCU's (and TREE_PREEMPT_RCU's) race conditions by prohibiting grace periods from starting while force_quiescent_state() is active. Patch 10 maintains grace-period latency by the simple expedient of having force_quiescent_state() check to see if someone wanted to start a grace period, and, if so, starting one on their behalf.

Patch 11 adds parameters to rcutorture to allow testing with extremely rapid re-invocations of force_quiescent_state() -- microseconds rather than the previous milliseconds.

Patch 12 makes the RCU and rcutorture entries of the MAINTAINERS file call out the correct source files, which have changed due to the recent re-implementation.

Patches 13-18 add debugging checks, so that an rcu_dereference(p) can now be rcu_dereference(p, rcu_read_lock_held()), which will complain if invoked outside of an RCU read-side critical section when CONFIG_PROVE_LOCKING is specified. There are also rcu_read_lock_bh_held(), rcu_read_lock_sched_held(), and srcu_read_lock_held() for the other flavors of RCU.

One can also do something like:

	p = rcu_dereference_check(gp, rcu_read_lock_bh_held() ||
				  lockdep_is_held(my_lock));

to handle the case where either the access must either be protected by RCU-bh or by my_lock.

Again, strictly FYI, not yet for inclusion.

Thanx, Paul