Move TINY_RCU quiescent state out of extended quiescent state
PATCH 1/1 Move TINY_RCU quiescent state out of extended quiescent state
TINY_RCU's rcu_idle_enter_common() invokes rcu_sched_qs() in order to inform the RCU core of the quiescent state implied by idle entry. Of course, idle is also an extended quiescent state, so that the call to rcu_sched_qs() speeds up RCU's invoking of any callbacks that might be queued. This speed-up is important when entering into dyntick-idle mode -- if there are no further scheduling-clock interrupts, the callbacks might never be invoked, which could result in a system hang.
However, processing callbacks does event tracing, which in turn implies RCU read-side critical sections, which are illegal in extended quiescent states. This patch therefore moves the call to rcu_sched_qs() so that it precedes the point at which we set the new value of rcu_dynticks_nesting, which may indicate RCU is in an extended quiescent state.
--- kernel/rcutiny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcutiny.c +1 -1
@@ -75,9 +75,9 @@ static void rcu_idle_enter_common(long long newval) current->pid, current->comm, idle->pid, idle->comm); /* must be idle task! */ } +rcu_sched_qs (0 );/* implies rcu_bh_qsctr_inc(0) */ barrier (); rcu_dynticks_nesting = newval; -rcu_sched_qs (0 );/* implies rcu_bh_qsctr_inc(0) */ }/*
Signature · 1 line
1.7.9.5
Quoted 8 lines · Li Zhong
TINY_RCU's
rcu_idle_enter_common()invokesrcu_sched_qs()in order to inform the RCU core of the quiescent state implied by idle entry. Of course, idle is also an extended quiescent state, so that the call torcu_sched_qs()speeds up RCU's invoking of any callbacks that might be queued. This speed-up is important when entering into dyntick-idle mode -- if there are no further scheduling-clock interrupts, the callbacks might never be invoked, which could result in a system hang.
Quoted 6 lines
However, processing callbacks does event tracing, which in turn implies RCU read-side critical sections, which are illegal in extended quiescent states. This patch therefore moves the call to
rcu_sched_qs()so that it precedes the point at which we set the new value ofrcu_dynticks_nesting, which may indicate RCU is in an extended quiescent state.
Thank you, Zhong. Queued, as those checking the SOBs below might guess. ;-)
Thanx, paul
Quoted 26 lines
Signed-off-by Li Zhong <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>--- kernel/rcutiny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcutiny.c +1
-1@@ -75,9 +75,9 @@ static void rcu_idle_enter_common(long long newval) current->pid, current->comm, idle->pid, idle->comm); /* must be idle task! */ } +rcu_sched_qs (0 );/* implies rcu_bh_qsctr_inc(0) */ barrier (); rcu_dynticks_nesting = newval; -rcu_sched_qs (0 );/* implies rcu_bh_qsctr_inc(0) */ }/* Signature · 1 line
1.7.9.5