rcu: Avoid unnecessary softirq when system is idle
When there are no callbacks pending on an idle system, I noticed that RCU softirq is continuously firing. During this the cpu_no_qs is set to false, and core_needs_qs is set to true indefinitely. This causes rcu_process_callbacks to be repeatedly called, even though the node corresponding to the CPU has that CPU's mask bit cleared and the system is idle. I believe the race is when such mask clearing is done during idle CPU scan of the quiescent state forcing stage in the kthread instead of the softirq. Since the rnp mask is cleared, but the flags on the CPU's rdp are not cleared, the CPU thinks it still needs to report to core RCU. Cure this by clearing the core_needs_qs flag when the CPU detects that its node is already updated which will avoid the unwanted softirq raises to the benefit of real-time systems. Test: Ran rcutorture for various tree RCU configs. Change-Id: Iee374d1dcdc74ecc5e6816a99be51feddd876931 Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Signed-off-by: mydongistiny <jaysonedson@gmail.com>
This commit is contained in:
parent
35df832f54
commit
323a4009a4
1 changed files with 1 additions and 0 deletions
|
@ -2289,6 +2289,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
|
|||
mask = rdp->grpmask;
|
||||
rdp->core_needs_qs = false;
|
||||
if ((rnp->qsmask & mask) == 0) {
|
||||
rdp->core_needs_qs = false;
|
||||
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
|
||||
} else {
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue