mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
rcu: Avoid self-IPI in sync_rcu_exp_select_node_cpus()
Although sync_rcu_exp_select_node_cpus() treats the current CPU as being in a quiescent state, it might well migrate to some other CPU before reaching the smp_call_function_single(), which could then result in an unnecessary simulated self-IPI. This commit therefore instead simply refuses to invoke smp_call_function_single() on the current CPU, which causes the later rcu_report_exp_cpu_mult() to report this CPU's quiescent state with less overhead. This also reduces the rcu_exp_handler() function's state space by removing the direct call that this smp_call_function_single() uses to emulate the requested self-IPI. Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> [ paulmck: Use get_cpu() instead of preempt_disable() per Joel Fernandes. ]
This commit is contained in:
parent
43e903ad3e
commit
b9ad4d6ed1
1 changed files with 5 additions and 0 deletions
|
@ -384,7 +384,12 @@ retry_ipi:
|
||||||
mask_ofl_test |= mask;
|
mask_ofl_test |= mask;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (get_cpu() == cpu) {
|
||||||
|
put_cpu();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ret = smp_call_function_single(cpu, rcu_exp_handler, NULL, 0);
|
ret = smp_call_function_single(cpu, rcu_exp_handler, NULL, 0);
|
||||||
|
put_cpu();
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
mask_ofl_ipi &= ~mask;
|
mask_ofl_ipi &= ~mask;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue