@@ -244,27 +244,6 @@ static void __init rcu_spawn_tasks_kthread_generic(struct rcu_tasks *rtp)
244
244
smp_mb (); /* Ensure others see full kthread. */
245
245
}
246
246
247
- /* Do the srcu_read_lock() for the above synchronize_srcu(). */
248
- void exit_tasks_rcu_start (void ) __acquires (& tasks_rcu_exit_srcu )
249
- {
250
- preempt_disable ();
251
- current -> rcu_tasks_idx = __srcu_read_lock (& tasks_rcu_exit_srcu );
252
- preempt_enable ();
253
- }
254
-
255
- static void exit_tasks_rcu_finish_trace (struct task_struct * t );
256
-
257
- /* Do the srcu_read_unlock() for the above synchronize_srcu(). */
258
- void exit_tasks_rcu_finish (void ) __releases (& tasks_rcu_exit_srcu )
259
- {
260
- struct task_struct * t = current ;
261
-
262
- preempt_disable ();
263
- __srcu_read_unlock (& tasks_rcu_exit_srcu , t -> rcu_tasks_idx );
264
- preempt_enable ();
265
- exit_tasks_rcu_finish_trace (t );
266
- }
267
-
268
247
#ifndef CONFIG_TINY_RCU
269
248
270
249
/*
@@ -303,7 +282,9 @@ static void show_rcu_tasks_generic_gp_kthread(struct rcu_tasks *rtp, char *s)
303
282
s );
304
283
}
305
284
306
- #ifdef CONFIG_TASKS_RCU
285
+ static void exit_tasks_rcu_finish_trace (struct task_struct * t );
286
+
287
+ #if defined(CONFIG_TASKS_RCU ) || defined(CONFIG_TASKS_TRACE_RCU )
307
288
308
289
////////////////////////////////////////////////////////////////////////
309
290
//
@@ -374,6 +355,10 @@ static void rcu_tasks_wait_gp(struct rcu_tasks *rtp)
374
355
rtp -> postgp_func (rtp );
375
356
}
376
357
358
+ #endif /* #if defined(CONFIG_TASKS_RCU) || defined(CONFIG_TASKS_TRACE_RCU) */
359
+
360
+ #ifdef CONFIG_TASKS_RCU
361
+
377
362
////////////////////////////////////////////////////////////////////////
378
363
//
379
364
// Simple variant of RCU whose quiescent states are voluntary context
@@ -577,8 +562,29 @@ static void show_rcu_tasks_classic_gp_kthread(void)
577
562
show_rcu_tasks_generic_gp_kthread (& rcu_tasks , "" );
578
563
}
579
564
565
+ /* Do the srcu_read_lock() for the above synchronize_srcu(). */
566
+ void exit_tasks_rcu_start (void ) __acquires (& tasks_rcu_exit_srcu )
567
+ {
568
+ preempt_disable ();
569
+ current -> rcu_tasks_idx = __srcu_read_lock (& tasks_rcu_exit_srcu );
570
+ preempt_enable ();
571
+ }
572
+
573
+ /* Do the srcu_read_unlock() for the above synchronize_srcu(). */
574
+ void exit_tasks_rcu_finish (void ) __releases (& tasks_rcu_exit_srcu )
575
+ {
576
+ struct task_struct * t = current ;
577
+
578
+ preempt_disable ();
579
+ __srcu_read_unlock (& tasks_rcu_exit_srcu , t -> rcu_tasks_idx );
580
+ preempt_enable ();
581
+ exit_tasks_rcu_finish_trace (t );
582
+ }
583
+
580
584
#else /* #ifdef CONFIG_TASKS_RCU */
581
585
static void show_rcu_tasks_classic_gp_kthread (void ) { }
586
+ void exit_tasks_rcu_start (void ) { }
587
+ void exit_tasks_rcu_finish (void ) { exit_tasks_rcu_finish_trace (current ); }
582
588
#endif /* #else #ifdef CONFIG_TASKS_RCU */
583
589
584
590
#ifdef CONFIG_TASKS_RUDE_RCU
@@ -1075,7 +1081,7 @@ static void rcu_tasks_trace_postgp(struct rcu_tasks *rtp)
1075
1081
}
1076
1082
1077
1083
/* Report any needed quiescent state for this exiting task. */
1078
- void exit_tasks_rcu_finish_trace (struct task_struct * t )
1084
+ static void exit_tasks_rcu_finish_trace (struct task_struct * t )
1079
1085
{
1080
1086
WRITE_ONCE (t -> trc_reader_checked , true);
1081
1087
WARN_ON_ONCE (t -> trc_reader_nesting );
@@ -1170,7 +1176,7 @@ static void show_rcu_tasks_trace_gp_kthread(void)
1170
1176
}
1171
1177
1172
1178
#else /* #ifdef CONFIG_TASKS_TRACE_RCU */
1173
- void exit_tasks_rcu_finish_trace (struct task_struct * t ) { }
1179
+ static void exit_tasks_rcu_finish_trace (struct task_struct * t ) { }
1174
1180
static inline void show_rcu_tasks_trace_gp_kthread (void ) {}
1175
1181
#endif /* #else #ifdef CONFIG_TASKS_TRACE_RCU */
1176
1182
0 commit comments