diff options
author | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-01-11 23:36:45 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.ibm.com> | 2019-03-26 17:40:13 -0400 |
commit | 21d0d79ab051bf9facb9960a30e58b93a31c75a5 (patch) | |
tree | 23a5525d518fb387fb4819f6e0deae7ba84c542b | |
parent | 32255d51b6ed00de2b88970ceea8db0ec3bae6f8 (diff) |
rcu: Inline RCU task stall-warning helper functions
The rcu_print_detail_task_stall(), rcu_print_task_stall_begin(), and
rcu_print_task_stall_end() functions were defined to allow long-gone
Kconfig options to provide an abbreviated RCU CPU stall warning printout.
This commit saves a few lines of code by inlining them into their sole
callers.
While in the area, a useless call of rcu_print_detail_task_stall_rnp()
on the root rcu_node structure was eliminated. If there is only one
rcu_node structure, its tasks get printed twice, but if there are more,
the root rcu_node structure is guaranteed to have an empty list of blocked
tasks, hence the uselessness. (Long ago, root rcu_node structures with
non-empty ->blkd_tasks lists could happen, but no longer.)
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
-rw-r--r-- | kernel/rcu/tree.h | 1 | ||||
-rw-r--r-- | kernel/rcu/tree_stall.h | 36 |
2 files changed, 7 insertions, 30 deletions
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 3c4e26fff806..c6df9a13dd06 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h | |||
@@ -445,7 +445,6 @@ static void rcu_dynticks_task_enter(void); | |||
445 | static void rcu_dynticks_task_exit(void); | 445 | static void rcu_dynticks_task_exit(void); |
446 | 446 | ||
447 | /* Forward declarations for tree_stall.h */ | 447 | /* Forward declarations for tree_stall.h */ |
448 | static void rcu_print_detail_task_stall(void); | ||
449 | static int rcu_print_task_stall(struct rcu_node *rnp); | 448 | static int rcu_print_task_stall(struct rcu_node *rnp); |
450 | static void record_gp_stall_check_time(void); | 449 | static void record_gp_stall_check_time(void); |
451 | static void check_cpu_stall(struct rcu_data *rdp); | 450 | static void check_cpu_stall(struct rcu_data *rdp); |
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index e0e73f493363..b476786b8ef7 100644 --- a/kernel/rcu/tree_stall.h +++ b/kernel/rcu/tree_stall.h | |||
@@ -95,30 +95,6 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp) | |||
95 | } | 95 | } |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * Dump detailed information for all tasks blocking the current RCU | ||
99 | * grace period. | ||
100 | */ | ||
101 | static void rcu_print_detail_task_stall(void) | ||
102 | { | ||
103 | struct rcu_node *rnp = rcu_get_root(); | ||
104 | |||
105 | rcu_print_detail_task_stall_rnp(rnp); | ||
106 | rcu_for_each_leaf_node(rnp) | ||
107 | rcu_print_detail_task_stall_rnp(rnp); | ||
108 | } | ||
109 | |||
110 | static void rcu_print_task_stall_begin(struct rcu_node *rnp) | ||
111 | { | ||
112 | pr_err("\tTasks blocked on level-%d rcu_node (CPUs %d-%d):", | ||
113 | rnp->level, rnp->grplo, rnp->grphi); | ||
114 | } | ||
115 | |||
116 | static void rcu_print_task_stall_end(void) | ||
117 | { | ||
118 | pr_cont("\n"); | ||
119 | } | ||
120 | |||
121 | /* | ||
122 | * Scan the current list of tasks blocked within RCU read-side critical | 98 | * Scan the current list of tasks blocked within RCU read-side critical |
123 | * sections, printing out the tid of each. | 99 | * sections, printing out the tid of each. |
124 | */ | 100 | */ |
@@ -129,14 +105,15 @@ static int rcu_print_task_stall(struct rcu_node *rnp) | |||
129 | 105 | ||
130 | if (!rcu_preempt_blocked_readers_cgp(rnp)) | 106 | if (!rcu_preempt_blocked_readers_cgp(rnp)) |
131 | return 0; | 107 | return 0; |
132 | rcu_print_task_stall_begin(rnp); | 108 | pr_err("\tTasks blocked on level-%d rcu_node (CPUs %d-%d):", |
109 | rnp->level, rnp->grplo, rnp->grphi); | ||
133 | t = list_entry(rnp->gp_tasks->prev, | 110 | t = list_entry(rnp->gp_tasks->prev, |
134 | struct task_struct, rcu_node_entry); | 111 | struct task_struct, rcu_node_entry); |
135 | list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) { | 112 | list_for_each_entry_continue(t, &rnp->blkd_tasks, rcu_node_entry) { |
136 | pr_cont(" P%d", t->pid); | 113 | pr_cont(" P%d", t->pid); |
137 | ndetected++; | 114 | ndetected++; |
138 | } | 115 | } |
139 | rcu_print_task_stall_end(); | 116 | pr_cont("\n"); |
140 | return ndetected; | 117 | return ndetected; |
141 | } | 118 | } |
142 | 119 | ||
@@ -146,7 +123,7 @@ static int rcu_print_task_stall(struct rcu_node *rnp) | |||
146 | * Because preemptible RCU does not exist, we never have to check for | 123 | * Because preemptible RCU does not exist, we never have to check for |
147 | * tasks blocked within RCU read-side critical sections. | 124 | * tasks blocked within RCU read-side critical sections. |
148 | */ | 125 | */ |
149 | static void rcu_print_detail_task_stall(void) | 126 | static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp) |
150 | { | 127 | { |
151 | } | 128 | } |
152 | 129 | ||
@@ -253,7 +230,7 @@ static void print_other_cpu_stall(unsigned long gp_seq) | |||
253 | unsigned long gpa; | 230 | unsigned long gpa; |
254 | unsigned long j; | 231 | unsigned long j; |
255 | int ndetected = 0; | 232 | int ndetected = 0; |
256 | struct rcu_node *rnp = rcu_get_root(); | 233 | struct rcu_node *rnp; |
257 | long totqlen = 0; | 234 | long totqlen = 0; |
258 | 235 | ||
259 | /* Kick and suppress, if so configured. */ | 236 | /* Kick and suppress, if so configured. */ |
@@ -291,7 +268,8 @@ static void print_other_cpu_stall(unsigned long gp_seq) | |||
291 | rcu_dump_cpu_stacks(); | 268 | rcu_dump_cpu_stacks(); |
292 | 269 | ||
293 | /* Complain about tasks blocking the grace period. */ | 270 | /* Complain about tasks blocking the grace period. */ |
294 | rcu_print_detail_task_stall(); | 271 | rcu_for_each_leaf_node(rnp) |
272 | rcu_print_detail_task_stall_rnp(rnp); | ||
295 | } else { | 273 | } else { |
296 | if (rcu_seq_current(&rcu_state.gp_seq) != gp_seq) { | 274 | if (rcu_seq_current(&rcu_state.gp_seq) != gp_seq) { |
297 | pr_err("INFO: Stall ended before state dump start\n"); | 275 | pr_err("INFO: Stall ended before state dump start\n"); |