Skip to content

Commit 9796e1a

Browse files
committed
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. Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 7e3b70e commit 9796e1a

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

kernel/rcu/tasks.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct rcu_tasks;
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)
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)
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,
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

0 commit comments

Comments
 (0)