rcu: Make rcu_normal_after_boot writable again
authorJuri Lelli <juri.lelli@redhat.com>
Tue, 10 Aug 2021 08:48:15 +0000 (10:48 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Mon, 13 Sep 2021 23:32:46 +0000 (16:32 -0700)
Certain configurations (e.g., systems that make heavy use of netns)
need to use synchronize_rcu_expedited() to service RCU grace periods
even after boot.

Even though synchronize_rcu_expedited() has been traditionally
considered harmful for RT for the heavy use of IPIs, it is perfectly
usable under certain conditions (e.g. nohz_full).

Make rcupdate.rcu_normal_after_boot= again writeable on RT (if NO_HZ_
FULL is defined), but keep its default value to 1 (enabled) to avoid
regressions. Users who need synchronize_rcu_expedited() will boot with
rcupdate.rcu_normal_after_ boot=0 in the kernel cmdline.

Reflect the change in synchronize_rcu_expedited_wait() by removing the
WARN related to CONFIG_PREEMPT_RT.

Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_exp.h
kernel/rcu/update.c

index 2796084..d9e4f8e 100644 (file)
@@ -512,7 +512,6 @@ static void synchronize_rcu_expedited_wait(void)
                j = READ_ONCE(jiffies_till_first_fqs);
                if (synchronize_rcu_expedited_wait_once(j + HZ))
                        return;
-               WARN_ON_ONCE(IS_ENABLED(CONFIG_PREEMPT_RT));
        }
 
        for (;;) {
index c21b38c..bd55113 100644 (file)
@@ -57,7 +57,7 @@
 module_param(rcu_expedited, int, 0);
 module_param(rcu_normal, int, 0);
 static int rcu_normal_after_boot = IS_ENABLED(CONFIG_PREEMPT_RT);
-#ifndef CONFIG_PREEMPT_RT
+#if !defined(CONFIG_PREEMPT_RT) || defined(CONFIG_NO_HZ_FULL)
 module_param(rcu_normal_after_boot, int, 0);
 #endif
 #endif /* #ifndef CONFIG_TINY_RCU */