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

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/rcu/tasks.h+13−5
@@ -15,7 +15,7 @@ struct rcu_tasks; · 14 unmodified lines
15typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);15typedef void (*rcu_tasks_gp_func_t)(struct rcu_tasks *rtp);
16typedef void (*pregp_func_t)(void);16typedef void (*pregp_func_t)(void);
17typedef void (*pertask_func_t)(struct task_struct *t, struct list_head *hop);17typedef void (*pertask_func_t)(struct task_struct *t, struct list_head *hop);
18typedef void (*postscan_func_t)(void);18typedef void (*postscan_func_t)(struct list_head *hop);
19typedef void (*holdouts_func_t)(struct list_head *hop, bool ndrpt, bool *frptp);19typedef void (*holdouts_func_t)(struct list_head *hop, bool ndrpt, bool *frptp);
20typedef void (*postgp_func_t)(struct rcu_tasks *rtp);20typedef void (*postgp_func_t)(struct rcu_tasks *rtp);
21 21
@@ -331,7 +331,7 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp) · 309 unmodified lines
331 rcu_read_unlock();331 rcu_read_unlock();
332 332
333 set_tasks_gp_state(rtp, RTGS_POST_SCAN_TASKLIST);333 set_tasks_gp_state(rtp, RTGS_POST_SCAN_TASKLIST);
334 rtp->postscan_func();334 rtp->postscan_func(&holdouts);
335 335
336 /*336 /*
337 * Each pass through the following loop scans the list of holdout337 * 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
415}415}
416 416
417/* Processing between scanning taskslist and draining the holdout list. */417/* Processing between scanning taskslist and draining the holdout list. */
418void rcu_tasks_postscan(void)418void rcu_tasks_postscan(struct list_head *hop)
419{419{
420 /*420 /*
421 * Wait for tasks that are in the process of exiting. This421 * 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
936 trc_wait_for_one_reader(t, hop);936 trc_wait_for_one_reader(t, hop);
937}937}
938 938
939/* Do intermediate processing between task and holdout scans. */939/*
940static void rcu_tasks_trace_postscan(void)940 * Do intermediate processing between task and holdout scans and
941 * pick up the idle tasks.
942 */
943static void rcu_tasks_trace_postscan(struct list_head *hop)
941{944{
945 int cpu;
946
947 for_each_possible_cpu(cpu)
948 rcu_tasks_trace_pertask(idle_task(cpu), hop);
949
942 // Re-enable CPU hotplug now that the tasklist scan has completed.950 // Re-enable CPU hotplug now that the tasklist scan has completed.
943 cpus_read_unlock();951 cpus_read_unlock();
944 952

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