Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 49a17639508c3 ("softirq: Use a dedicated thread for timer wakeups on PREEMPT_RT.")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: <linux-trace-kernel@vger.kernel.org>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>

authored by

Paul E. McKenney and committed by
Boqun Feng
23c22d91 85aad7cc

+4 -8
-6
include/linux/rcupdate.h
··· 121 121 extern int rcu_scheduler_active; 122 122 void rcu_sched_clock_irq(int user); 123 123 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 - 130 124 #ifdef CONFIG_RCU_STALL_COMMON 131 125 void rcu_sysrq_start(void); 132 126 void rcu_sysrq_end(void);
-1
init/main.c
··· 1553 1553 1554 1554 init_mm_internals(); 1555 1555 1556 - rcu_init_tasks_generic(); 1557 1556 do_pre_smp_initcalls(); 1558 1557 lockup_detector_init(); 1559 1558
+4 -1
kernel/rcu/tasks.h
··· 2256 2256 #endif 2257 2257 } 2258 2258 2259 - void __init rcu_init_tasks_generic(void) 2259 + static int __init rcu_init_tasks_generic(void) 2260 2260 { 2261 2261 #ifdef CONFIG_TASKS_RCU 2262 2262 rcu_spawn_tasks_kthread(); ··· 2272 2272 2273 2273 // Run the self-tests. 2274 2274 rcu_tasks_initiate_self_tests(); 2275 + 2276 + return 0; 2275 2277 } 2278 + core_initcall(rcu_init_tasks_generic); 2276 2279 2277 2280 #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */ 2278 2281 static inline void rcu_tasks_bootup_oddness(void) {}