rcu: Fix existing exp request check in sync_sched_exp_online_cleanup()
PATCH 1/1 rcu: Fix existing exp request check in sync_sched_exp_online_cleanup()
The sync_sched_exp_online_cleanup() checks to see if RCU needs an expedited quiescent state from the incoming CPU, sending it an IPI if so. Before sending IPI, it checks whether expedited qs need has been already requested for the incoming CPU, by checking rcu_data.cpu_no_qs.b.exp for the current cpu, on which sync_sched_exp_online_cleanup() is running. This works for the case where incoming CPU is same as self. However, for the case where incoming CPU is different from self, expedited request won't get marked, which can potentially delay reporting of expedited quiescent state for the incoming CPU.
--- kernel/rcu/tree_exp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree_exp.h +1 -1
@@ -759,7 +759,7 @@ static void sync_sched_exp_online_cleanup(int cpu) my_cpu =get_cpu ();/* Quiescent state either not needed or already requested, leave. */ if (!(READ_ONCE (rnp->expmask) & rdp->grpmask) || -__this_cpu_read (rcu_data.cpu_no_qs.b.exp)) { + rdp->cpu_no_qs.b.exp) {put_cpu ();return ; }
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Paul E. McKenney
maintainerQuoted 11 lines · Neeraj Upadhyay
The
sync_sched_exp_online_cleanup()checks to see if RCU needs an expedited quiescent state from the incoming CPU, sending it an IPI if so. Before sending IPI, it checks whether expedited qs need has been already requested for the incoming CPU, by checking rcu_data.cpu_no_qs.b.exp for the current cpu, on whichsync_sched_exp_online_cleanup()is running. This works for the case where incoming CPU is same as self. However, for the case where incoming CPU is different from self, expedited request won't get marked, which can potentially delay reporting of expedited quiescent state for the incoming CPU.
Quoted 2 lines
Fixes e015a3411220 ("rcu: Avoid self-IPI in sync_sched_exp_online_cleanup()")Signed-off-by Neeraj Upadhyay <[email protected]>
Good catch!!! I have queued this for further review and testing, thank you!
Thanx, Paul
Quoted 21 lines
--- kernel/rcu/tree_exp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/rcu/tree_exp.h +1
-1@@ -759,7 +759,7 @@ static void sync_sched_exp_online_cleanup(int cpu) my_cpu =get_cpu ();/* Quiescent state either not needed or already requested, leave. */ if (!(READ_ONCE (rnp->expmask) & rdp->grpmask) || -__this_cpu_read (rcu_data.cpu_no_qs.b.exp)) { + rdp->cpu_no_qs.b.exp) {put_cpu ();return ; }Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation