Skip to content

Commit 23c22d9

Browse files
paulmckrcufbq
authored andcommitted
rcu-tasks: Move RCU Tasks self-tests to core_initcall()
The timer and hrtimer softirq processing has moved to dedicated threads for kernels built with CONFIG_IRQ_FORCED_THREADING=y. This results in timers not expiring until later in early boot, which in turn causes the RCU Tasks self-tests to hang in kernels built with CONFIG_PROVE_RCU=y, which further causes the entire kernel to hang. One fix would be to make timers work during this time, but there are no known users of RCU Tasks grace periods during that time, so no justification for the added complexity. Not yet, anyway. This commit therefore moves the call to rcu_init_tasks_generic() from kernel_init_freeable() to a core_initcall(). This works because the timer and hrtimer kthreads are created at early_initcall() time. Fixes: 49a1763 ("softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.") Signed-off-by: Paul E. McKenney <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: <[email protected]> Tested-by: Sebastian Andrzej Siewior <[email protected]> Reviewed-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Boqun Feng <[email protected]>
1 parent 85aad7c commit 23c22d9

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

include/linux/rcupdate.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ void rcu_init(void);
121121
extern int rcu_scheduler_active;
122122
void rcu_sched_clock_irq(int user);
123123

124-
#ifdef CONFIG_TASKS_RCU_GENERIC
125-
void rcu_init_tasks_generic(void);
126-
#else
127-
static inline void rcu_init_tasks_generic(void) { }
128-
#endif
129-
130124
#ifdef CONFIG_RCU_STALL_COMMON
131125
void rcu_sysrq_start(void);
132126
void rcu_sysrq_end(void);

init/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,6 @@ static noinline void __init kernel_init_freeable(void)
15531553

15541554
init_mm_internals();
15551555

1556-
rcu_init_tasks_generic();
15571556
do_pre_smp_initcalls();
15581557
lockup_detector_init();
15591558

kernel/rcu/tasks.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2256,7 +2256,7 @@ void __init tasks_cblist_init_generic(void)
22562256
#endif
22572257
}
22582258

2259-
void __init rcu_init_tasks_generic(void)
2259+
static int __init rcu_init_tasks_generic(void)
22602260
{
22612261
#ifdef CONFIG_TASKS_RCU
22622262
rcu_spawn_tasks_kthread();
@@ -2272,7 +2272,10 @@ void __init rcu_init_tasks_generic(void)
22722272

22732273
// Run the self-tests.
22742274
rcu_tasks_initiate_self_tests();
2275+
2276+
return 0;
22752277
}
2278+
core_initcall(rcu_init_tasks_generic);
22762279

22772280
#else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
22782281
static inline void rcu_tasks_bootup_oddness(void) {}

0 commit comments

Comments
 (0)