History

rcu/exp: Mark current CPU as exp-QS in IPI loop second pass

Expedited RCU grace periods invoke sync_rcu_exp_select_node_cpus(), which takes two passes over the leaf rcu_node structure's CPUs. The first pass gathers up the current CPU and CPUs that are in dynticks idle mode. The workqueue will report a quiescent state on their behalf later. The second pass sends IPIs to the rest of the CPUs, but excludes the current CPU, incorrectly assuming it has been included in the first pass's list of CPUs. Unfortunately the current CPU may have changed between the first and second pass, due to the fact that the various rcu_node structures' ->lock fields have been dropped, thus momentarily enabling preemption. This means that if the second pass's CPU was not on the first pass's list, it will be ignored completely. There will be no IPI sent to it, and there will be no reporting of quiescent states on its behalf. Unfortunately, the expedited grace period will nevertheless be waiting for that CPU to report a quiescent state, but with that CPU having no reason to believe that such a report is needed. The result will be an expedited grace period stall. Fix this by no longer excluding the current CPU from consideration during the second pass.

Frederic Weisbecker committed 4 years ago

Commit 81f6d491 parent 790da241 file · +1 −0Browse files

Unified · Split

kernel/rcu/tree_exp.h+1−0
@@ -387,6 +387,7 @@ retry_ipi: · 386 unmodified lines
387 continue;387 continue;
388 }388 }
389 if (get_cpu() == cpu) {389 if (get_cpu() == cpu) {
390 mask_ofl_test |= mask;
390 put_cpu();391 put_cpu();
391 continue;392 continue;
392 }393 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t