rcu: Make cond_resched_rcu_qs() supply RCU-sched expedited QS
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 13 Jan 2016 21:57:54 +0000 (13:57 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 31 Mar 2016 20:34:04 +0000 (13:34 -0700)
commita1e1224849d9610b50fd1dd7d6f44308a59e46af
tree2afb8ee96c6471f865484383a2cb1ab8d3b9b2c3
parent251c617c75f48e03523c43c4ce1dff44bc3ae2bd
rcu: Make cond_resched_rcu_qs() supply RCU-sched expedited QS

Although cond_resched_rcu_qs() supplies quiescent states to all flavors
of normal RCU grace periods, it does nothing for expedited RCU-sched
grace periods.  This commit therefore adds a check for a need for a
quiescent state from the current CPU by an expedited RCU-sched grace
period, and invokes rcu_sched_qs() to supply that quiescent state if so.

Note that the check is racy in that we might be migrated to some other
CPU just after checking the per-CPU variable.  This is OK because the
act of migration will do a context switch, which will supply the needed
quiescent state.  The only downside is that we might do an unnecessary
call to rcu_sched_qs(), but the probability is low and the overhead
is small.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c