Skip to content

Commit 271a846

Browse files
committed
rcuscale: Measure RCU Tasks Trace grace-period kthread CPU time
This commit causes RCU Tasks Trace to output the CPU time consumed by its grace-period kthread. The CPU time is whatever is in the designated task's current->stime field, and thus is controlled by whatever CPU-time accounting scheme is in effect. This output appears in microseconds as follows on the console: rcu_scale: Grace-period kthread CPU time: 42367.037 [ paulmck: Apply Willy Tarreau feedback. ] Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 1d702e2 commit 271a846

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

kernel/rcu/rcu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ void rcu_async_relax(void);
505505
void rcupdate_announce_bootup_oddness(void);
506506
#ifdef CONFIG_TASKS_RCU_GENERIC
507507
void show_rcu_tasks_gp_kthreads(void);
508+
# ifdef CONFIG_TASKS_RCU
509+
struct task_struct *get_rcu_tasks_gp_kthread(void);
510+
# endif // # ifdef CONFIG_TASKS_RCU
508511
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
509512
static inline void show_rcu_tasks_gp_kthreads(void) {}
510513
#endif /* #else #ifdef CONFIG_TASKS_RCU_GENERIC */

kernel/rcu/rcuscale.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ static struct rcu_scale_ops tasks_ops = {
298298
.gp_barrier = rcu_barrier_tasks,
299299
.sync = synchronize_rcu_tasks,
300300
.exp_sync = synchronize_rcu_tasks,
301+
.rso_gp_kthread = get_rcu_tasks_gp_kthread,
301302
.name = "tasks"
302303
};
303304

kernel/rcu/tasks.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,12 @@ void show_rcu_tasks_classic_gp_kthread(void)
10421042
EXPORT_SYMBOL_GPL(show_rcu_tasks_classic_gp_kthread);
10431043
#endif // !defined(CONFIG_TINY_RCU)
10441044

1045+
struct task_struct *get_rcu_tasks_gp_kthread(void)
1046+
{
1047+
return rcu_tasks.kthread_ptr;
1048+
}
1049+
EXPORT_SYMBOL_GPL(get_rcu_tasks_gp_kthread);
1050+
10451051
/*
10461052
* Contribute to protect against tasklist scan blind spot while the
10471053
* task is exiting and may be removed from the tasklist. See

0 commit comments

Comments
 (0)