History

rcu-tasks: Make RCU tasks trace also wait for idle tasks

This commit scans the CPUs, adding each CPU's idle task to the list of tasks that need quiescent states.

Paul E. McKenney committed 6 years ago

Commit 9796e1a1 parent 7e3b70e1 file · +13 −5Browse files

Unified · Split

kernel/rcu/tasks.h+13−5
@@ -15,7 +15,7 @@ struct rcu_tasks; · 14 unmodified lines
1515 typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
1616 typedef void (*pregp_func_t)(void);
1717 typedef void (*pertask_func_t)(struct task_struct *t, struct list_head *hop);
18−typedef void (*postscan_func_t)(void);
18+typedef void (*postscan_func_t)(struct list_head *hop);
1919 typedef void (*holdouts_func_t)(struct list_head *hop, bool ndrpt, bool *frptp);
2020 typedef void (*postgp_func_t)(struct rcu_tasks *rtp);
2121
@@ -331,7 +331,7 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) · 309 unmodified lines
331331 rcu_read_unlock();
332332
333333 set_tasks_gp_state(rtp, RTGS_POST_SCAN_TASKLIST);
334− rtp->postscan_func();
334+ rtp->postscan_func(&holdouts);
335335
336336 /*
337337 * Each pass through the following loop scans the list of holdout
@@ -415,7 +415,7 @@ static void rcu_tasks_pertask(struct task_struct *t, struct list_head *hop) · 77 unmodified lines
415415 }
416416
417417 /* Processing between scanning taskslist and draining the holdout list. */
418−void rcu_tasks_postscan(void)
418+void rcu_tasks_postscan(struct list_head *hop)
419419 {
420420 /*
421421 * Wait for tasks that are in the process of exiting. This
@@ -936,9 +936,17 @@ static void rcu_tasks_trace_pertask(struct task_struct *t, · 514 unmodified lines
936936 trc_wait_for_one_reader(t, hop);
937937 }
938938
939−/* Do intermediate processing between task and holdout scans. */
940−static void rcu_tasks_trace_postscan(void)
939+/*
940+ * Do intermediate processing between task and holdout scans and
941+ * pick up the idle tasks.
942+ */
943+static void rcu_tasks_trace_postscan(struct list_head *hop)
941944 {
945+ int cpu;
946+
947+ for_each_possible_cpu(cpu)
948+ rcu_tasks_trace_pertask(idle_task(cpu), hop);
949+
942950 // Re-enable CPU hotplug now that the tasklist scan has completed.
943951 cpus_read_unlock();
944952

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