rcu: Document reason for rcu_all_qs() call to preempt_disable()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 3 Aug 2022 15:48:12 +0000 (08:48 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 31 Aug 2022 12:03:14 +0000 (05:03 -0700)
Given that rcu_all_qs() is in non-preemptible kernels, why on earth should
it invoke preempt_disable()?  This commit adds the reason, which is to
work nicely with debugging enabled in CONFIG_PREEMPT_COUNT=y kernels.

Reported-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Reported-by: Boqun Feng <boqun.feng@gmail.com>
Reported-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree_plugin.h

index 4152816..c46b3c7 100644 (file)
@@ -870,7 +870,7 @@ void rcu_all_qs(void)
 
        if (!raw_cpu_read(rcu_data.rcu_urgent_qs))
                return;
-       preempt_disable();
+       preempt_disable();  // For CONFIG_PREEMPT_COUNT=y kernels
        /* Load rcu_urgent_qs before other flags. */
        if (!smp_load_acquire(this_cpu_ptr(&rcu_data.rcu_urgent_qs))) {
                preempt_enable();