Skip to content

Commit 8344496

Browse files
committed
rcu-tasks: Conditionally compile show_rcu_tasks_gp_kthreads()
The show_rcu_tasks_gp_kthreads() function is not invoked by Tiny RCU, but is nevertheless defined in Tiny RCU builds that enable Tasks Trace RCU. This commit therefore conditionally compiles this function so that it is defined only in builds that actually use it. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 5b3cc99 commit 8344496

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

kernel/rcu/tasks.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ module_param(rcu_task_stall_timeout, int, 0644);
103103
#define RTGS_WAIT_READERS 9
104104
#define RTGS_INVOKE_CBS 10
105105
#define RTGS_WAIT_CBS 11
106+
#ifndef CONFIG_TINY_RCU
106107
static const char * const rcu_tasks_gp_state_names[] = {
107108
"RTGS_INIT",
108109
"RTGS_WAIT_WAIT_CBS",
@@ -117,6 +118,7 @@ static const char * const rcu_tasks_gp_state_names[] = {
117118
"RTGS_INVOKE_CBS",
118119
"RTGS_WAIT_CBS",
119120
};
121+
#endif /* #ifndef CONFIG_TINY_RCU */
120122

121123
////////////////////////////////////////////////////////////////////////
122124
//
@@ -129,6 +131,7 @@ static void set_tasks_gp_state(struct rcu_tasks *rtp, int newstate)
129131
rtp->gp_jiffies = jiffies;
130132
}
131133

134+
#ifndef CONFIG_TINY_RCU
132135
/* Return state name. */
133136
static const char *tasks_gp_state_getname(struct rcu_tasks *rtp)
134137
{
@@ -139,6 +142,7 @@ static const char *tasks_gp_state_getname(struct rcu_tasks *rtp)
139142
return "???";
140143
return rcu_tasks_gp_state_names[j];
141144
}
145+
#endif /* #ifndef CONFIG_TINY_RCU */
142146

143147
// Enqueue a callback for the specified flavor of Tasks RCU.
144148
static void call_rcu_tasks_generic(struct rcu_head *rhp, rcu_callback_t func,
@@ -268,6 +272,7 @@ static void __init rcu_tasks_bootup_oddness(void)
268272

269273
#endif /* #ifndef CONFIG_TINY_RCU */
270274

275+
#ifndef CONFIG_TINY_RCU
271276
/* Dump out rcutorture-relevant state common to all RCU-tasks flavors. */
272277
static void show_rcu_tasks_generic_gp_kthread(struct rcu_tasks *rtp, char *s)
273278
{
@@ -281,6 +286,7 @@ static void show_rcu_tasks_generic_gp_kthread(struct rcu_tasks *rtp, char *s)
281286
".C"[!!data_race(rtp->cbs_head)],
282287
s);
283288
}
289+
#endif /* #ifndef CONFIG_TINY_RCU */
284290

285291
static void exit_tasks_rcu_finish_trace(struct task_struct *t);
286292

@@ -557,10 +563,12 @@ static int __init rcu_spawn_tasks_kthread(void)
557563
}
558564
core_initcall(rcu_spawn_tasks_kthread);
559565

566+
#ifndef CONFIG_TINY_RCU
560567
static void show_rcu_tasks_classic_gp_kthread(void)
561568
{
562569
show_rcu_tasks_generic_gp_kthread(&rcu_tasks, "");
563570
}
571+
#endif /* #ifndef CONFIG_TINY_RCU */
564572

565573
/* Do the srcu_read_lock() for the above synchronize_srcu(). */
566574
void exit_tasks_rcu_start(void) __acquires(&tasks_rcu_exit_srcu)
@@ -682,10 +690,12 @@ static int __init rcu_spawn_tasks_rude_kthread(void)
682690
}
683691
core_initcall(rcu_spawn_tasks_rude_kthread);
684692

693+
#ifndef CONFIG_TINY_RCU
685694
static void show_rcu_tasks_rude_gp_kthread(void)
686695
{
687696
show_rcu_tasks_generic_gp_kthread(&rcu_tasks_rude, "");
688697
}
698+
#endif /* #ifndef CONFIG_TINY_RCU */
689699

690700
#else /* #ifdef CONFIG_TASKS_RUDE_RCU */
691701
static void show_rcu_tasks_rude_gp_kthread(void) {}
@@ -1164,6 +1174,7 @@ static int __init rcu_spawn_tasks_trace_kthread(void)
11641174
}
11651175
core_initcall(rcu_spawn_tasks_trace_kthread);
11661176

1177+
#ifndef CONFIG_TINY_RCU
11671178
static void show_rcu_tasks_trace_gp_kthread(void)
11681179
{
11691180
char buf[64];
@@ -1174,18 +1185,21 @@ static void show_rcu_tasks_trace_gp_kthread(void)
11741185
data_race(n_heavy_reader_attempts));
11751186
show_rcu_tasks_generic_gp_kthread(&rcu_tasks_trace, buf);
11761187
}
1188+
#endif /* #ifndef CONFIG_TINY_RCU */
11771189

11781190
#else /* #ifdef CONFIG_TASKS_TRACE_RCU */
11791191
static void exit_tasks_rcu_finish_trace(struct task_struct *t) { }
11801192
static inline void show_rcu_tasks_trace_gp_kthread(void) {}
11811193
#endif /* #else #ifdef CONFIG_TASKS_TRACE_RCU */
11821194

1195+
#ifndef CONFIG_TINY_RCU
11831196
void show_rcu_tasks_gp_kthreads(void)
11841197
{
11851198
show_rcu_tasks_classic_gp_kthread();
11861199
show_rcu_tasks_rude_gp_kthread();
11871200
show_rcu_tasks_trace_gp_kthread();
11881201
}
1202+
#endif /* #ifndef CONFIG_TINY_RCU */
11891203

11901204
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
11911205
static inline void rcu_tasks_bootup_oddness(void) {}

0 commit comments

Comments
 (0)