Skip to content

Commit d6ad606

Browse files
committed
rcu-tasks: Ensure RCU Tasks Trace loops have quiescent states
The RCU Tasks Trace grace-period kthread loops across all CPUs, and there can be quite a few CPUs, with some commercially available systems sporting well over a thousand of them. Some of these loops can feature IPIs, which can take some time. This commit therefore places a call to cond_resched_tasks_rcu_qs() in each such loop. Link: https://docs.google.com/document/d/1V0YnG1HTWMt9WHJjroiJL9lf-hMrud4v8Fn3fhyY0cI/edit?usp=sharing Signed-off-by: Paul E. McKenney <[email protected]>
1 parent fcd53c8 commit d6ad606

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/rcu/tasks.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,7 @@ static void rcu_tasks_trace_pregp_step(struct list_head *hop)
15001500
if (rcu_tasks_trace_pertask_prep(t, true))
15011501
trc_add_holdout(t, hop);
15021502
rcu_read_unlock();
1503+
cond_resched_tasks_rcu_qs();
15031504
}
15041505

15051506
// Only after all running tasks have been accounted for is it
@@ -1520,6 +1521,7 @@ static void rcu_tasks_trace_pregp_step(struct list_head *hop)
15201521
raw_spin_lock_irqsave_rcu_node(rtpcp, flags);
15211522
}
15221523
raw_spin_unlock_irqrestore_rcu_node(rtpcp, flags);
1524+
cond_resched_tasks_rcu_qs();
15231525
}
15241526

15251527
// Re-enable CPU hotplug now that the holdout list is populated.
@@ -1619,6 +1621,7 @@ static void check_all_holdout_tasks_trace(struct list_head *hop,
16191621
trc_del_holdout(t);
16201622
else if (needreport)
16211623
show_stalled_task_trace(t, firstreport);
1624+
cond_resched_tasks_rcu_qs();
16221625
}
16231626

16241627
// Re-enable CPU hotplug now that the holdout list scan has completed.

0 commit comments

Comments
 (0)