]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rcu-tasks: Move RCU Tasks self-tests to core_initcall()
authorPaul E. McKenney <paulmck@kernel.org>
Fri, 20 Dec 2024 21:09:30 +0000 (13:09 -0800)
committerBoqun Feng <boqun.feng@gmail.com>
Wed, 5 Mar 2025 02:44:28 +0000 (18:44 -0800)
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>
include/linux/rcupdate.h
init/main.c
kernel/rcu/tasks.h

index 48e5c03df1dd83c246a61d0fcc8aa638adcd7654..36849a4ea1416fafa2695bbe7c4b244cfa1fd6e3 100644 (file)
@@ -121,12 +121,6 @@ void rcu_init(void);
 extern int rcu_scheduler_active;
 void rcu_sched_clock_irq(int user);
 
-#ifdef CONFIG_TASKS_RCU_GENERIC
-void rcu_init_tasks_generic(void);
-#else
-static inline void rcu_init_tasks_generic(void) { }
-#endif
-
 #ifdef CONFIG_RCU_STALL_COMMON
 void rcu_sysrq_start(void);
 void rcu_sysrq_end(void);
index 2a17578263970493474dd250bd62f395cca0dbe6..7f0a2a3dbd290acac77ea1791be8cfbe20f772ca 100644 (file)
@@ -1553,7 +1553,6 @@ static noinline void __init kernel_init_freeable(void)
 
        init_mm_internals();
 
-       rcu_init_tasks_generic();
        do_pre_smp_initcalls();
        lockup_detector_init();
 
index 59314da5eb60461db63c321dd21c180a91eb8788..466668eb4fadfaa2d765dbb152aa061455d8cb0a 100644 (file)
@@ -2256,7 +2256,7 @@ void __init tasks_cblist_init_generic(void)
 #endif
 }
 
-void __init rcu_init_tasks_generic(void)
+static int __init rcu_init_tasks_generic(void)
 {
 #ifdef CONFIG_TASKS_RCU
        rcu_spawn_tasks_kthread();
@@ -2272,7 +2272,10 @@ void __init rcu_init_tasks_generic(void)
 
        // Run the self-tests.
        rcu_tasks_initiate_self_tests();
+
+       return 0;
 }
+core_initcall(rcu_init_tasks_generic);
 
 #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
 static inline void rcu_tasks_bootup_oddness(void) {}