]> Git Repo - linux.git/commitdiff
rcu: Enable rcu_normal_after_boot unconditionally for RT
authorJulia Cartwright <[email protected]>
Tue, 15 Dec 2020 14:16:47 +0000 (15:16 +0100)
committerPaul E. McKenney <[email protected]>
Mon, 4 Jan 2021 21:43:51 +0000 (13:43 -0800)
Expedited RCU grace periods send IPIs to all non-idle CPUs, and thus can
disrupt time-critical code in real-time applications.  However, there
is a portion of boot-time processing (presumably before any real-time
applications have started) where expedited RCU grace periods are the only
option.  And so it is that experience with the -rt patchset indicates that
PREEMPT_RT systems should always set the rcupdate.rcu_normal_after_boot
kernel boot parameter.

This commit therefore makes the post-boot application environment safe
for real-time applications by making PREEMPT_RT systems disable the
rcupdate.rcu_normal_after_boot kernel boot parameter and acting as
if this parameter had been set.  This means that post-boot calls to
synchronize_rcu_expedited() will be treated as if they were instead
calls to synchronize_rcu(), thus preventing the IPIs, and thus avoiding
disrupting real-time applications.

Suggested-by: Luiz Capitulino <[email protected]>
Acked-by: Paul E. McKenney <[email protected]>
Signed-off-by: Julia Cartwright <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
[ paulmck: Update kernel-parameters.txt accordingly. ]
Signed-off-by: Paul E. McKenney <[email protected]>
Documentation/admin-guide/kernel-parameters.txt
kernel/rcu/update.c

index 521255f4ef13f128120710fc29f66885a2f833dd..e0008d9caccb44ddf352c7eec192785278f8f6c7 100644 (file)
                        only normal grace-period primitives.  No effect
                        on CONFIG_TINY_RCU kernels.
 
+                       But note that CONFIG_PREEMPT_RT=y kernels enables
+                       this kernel boot parameter, forcibly setting
+                       it to the value one, that is, converting any
+                       post-boot attempt at an expedited RCU grace
+                       period to instead use normal non-expedited
+                       grace-period processing.
+
        rcupdate.rcu_task_ipi_delay= [KNL]
                        Set time in jiffies during which RCU tasks will
                        avoid sending IPIs, starting with the beginning
index 39334d2d2b37991f1801a9ee8bf179db21d7fb0e..b95ae86c40a7d022742648d120c958b902a9557e 100644 (file)
 #ifndef CONFIG_TINY_RCU
 module_param(rcu_expedited, int, 0);
 module_param(rcu_normal, int, 0);
-static int rcu_normal_after_boot;
+static int rcu_normal_after_boot = IS_ENABLED(CONFIG_PREEMPT_RT);
+#ifndef CONFIG_PREEMPT_RT
 module_param(rcu_normal_after_boot, int, 0);
+#endif
 #endif /* #ifndef CONFIG_TINY_RCU */
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
This page took 0.113489 seconds and 4 git commands to generate.