All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: Delay the RCU-selftests during boot.
@ 2022-03-01 17:43 Sebastian Andrzej Siewior
  2022-03-01 17:48 ` Sebastian Andrzej Siewior
  2022-03-02  5:42 ` Paul E. McKenney
  0 siblings, 2 replies; 23+ messages in thread
From: Sebastian Andrzej Siewior @ 2022-03-01 17:43 UTC (permalink / raw)
  To: rcu
  Cc: Paul E. McKenney, Joel Fernandes, Josh Triplett, Lai Jiangshan,
	Mathieu Desnoyers, Steven Rostedt, Thomas Gleixner

The RCU-sefltest expects tthe timer_list timer to be working. This isn't
the case on PREEMPT_RT at this point because it requires that ksoftirqd
is up and running.
There is no known requirement that synchronize_rcu() works at this
point.

Delay RCU-selftests until ksoftirqd is up and running.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

Paul, I don't mean to be rude or anything by saying that "There is no
requirement…". If my memory serves me well here (and there is no
guarantee for that) then synchronize_rcu() was required that early by
kprobes or jump labels and this requirement was lifted by the time we
discussed this. I have no idea how this discussion back then ended but
as of v5.17-rc6 that timer is still required to function in order for
the system to make progress at boot time.

 include/linux/rcupdate.h |  6 ++++++
 init/main.c              |  1 +
 kernel/rcu/tasks.h       | 10 +++-------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 88b42eb464068..2fb1a48ca9272 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -95,6 +95,12 @@ void rcu_init_tasks_generic(void);
 static inline void rcu_init_tasks_generic(void) { }
 #endif
 
+#if defined(CONFIG_PROVE_RCU) && defined(CONFIG_TASKS_RCU_GENERIC)
+void rcu_tasks_initiate_self_tests(void);
+#else
+static inline void rcu_tasks_initiate_self_tests(void) {}
+#endif
+
 #ifdef CONFIG_RCU_STALL_COMMON
 void rcu_sysrq_start(void);
 void rcu_sysrq_end(void);
diff --git a/init/main.c b/init/main.c
index 65fa2e41a9c09..cfc45e47b9ca4 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1600,6 +1600,7 @@ static noinline void __init kernel_init_freeable(void)
 
 	rcu_init_tasks_generic();
 	do_pre_smp_initcalls();
+	rcu_tasks_initiate_self_tests();
 	lockup_detector_init();
 
 	smp_init();
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index d64f0b1d8cd3b..215c2c0f6c184 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1659,9 +1659,10 @@ static void test_rcu_tasks_callback(struct rcu_head *rhp)
 	pr_info("Callback from %s invoked.\n", rttd->name);
 
 	rttd->notrun = true;
+	WARN_ON(1);
 }
 
-static void rcu_tasks_initiate_self_tests(void)
+void rcu_tasks_initiate_self_tests(void)
 {
 	pr_info("Running RCU-tasks wait API self tests\n");
 #ifdef CONFIG_TASKS_RCU
@@ -1698,9 +1699,7 @@ static int rcu_tasks_verify_self_tests(void)
 	return ret;
 }
 late_initcall(rcu_tasks_verify_self_tests);
-#else /* #ifdef CONFIG_PROVE_RCU */
-static void rcu_tasks_initiate_self_tests(void) { }
-#endif /* #else #ifdef CONFIG_PROVE_RCU */
+#endif /* #ifdef CONFIG_PROVE_RCU */
 
 void __init rcu_init_tasks_generic(void)
 {
@@ -1715,9 +1714,6 @@ void __init rcu_init_tasks_generic(void)
 #ifdef CONFIG_TASKS_TRACE_RCU
 	rcu_spawn_tasks_trace_kthread();
 #endif
-
-	// Run the self-tests.
-	rcu_tasks_initiate_self_tests();
 }
 
 #else /* #ifdef CONFIG_TASKS_RCU_GENERIC */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-03-09 18:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01 17:43 [PATCH] rcu: Delay the RCU-selftests during boot Sebastian Andrzej Siewior
2022-03-01 17:48 ` Sebastian Andrzej Siewior
2022-03-02  5:42 ` Paul E. McKenney
2022-03-02 11:09   ` Sebastian Andrzej Siewior
2022-03-03  4:36     ` Paul E. McKenney
2022-03-03 10:10       ` Sebastian Andrzej Siewior
2022-03-03 20:02         ` Paul E. McKenney
2022-03-04 11:07           ` [PATCH] rcu-tasks: Use rcuwait for the rcu_tasks_kthread() Sebastian Andrzej Siewior
2022-03-04 23:21             ` Joel Fernandes
2022-03-05  4:40               ` Paul E. McKenney
2022-03-05  4:40             ` Paul E. McKenney
2022-03-07 11:17               ` Sebastian Andrzej Siewior
2022-03-07 15:09                 ` Paul E. McKenney
2022-03-07 17:57                   ` Sebastian Andrzej Siewior
2022-03-07 21:54                     ` Paul E. McKenney
2022-03-04 15:09           ` [PATCH] rcu: Delay the RCU-selftests during boot Sebastian Andrzej Siewior
2022-03-05  5:00             ` Paul E. McKenney
2022-03-07 17:54               ` Sebastian Andrzej Siewior
2022-03-07 21:53                 ` Paul E. McKenney
2022-03-08 11:29                   ` Sebastian Andrzej Siewior
2022-03-08 18:10                     ` Paul E. McKenney
2022-03-09 10:19                       ` Sebastian Andrzej Siewior
2022-03-09 18:37                         ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.