Commit 3ac85878 authored by Zhouyi Zhou's avatar Zhouyi Zhou Committed by Paul E. McKenney

rcu: Fix undefined Kconfig macros

Invoking scripts/checkkconfigsymbols.py in the Linux-kernel source tree
located the following issues:

1. TREE_PREEMPT_RCU
Referencing files: arch/sh/configs/sdk7786_defconfig

It should now be CONFIG_PREEMPT_RCU. Except that the CONFIG_PREEMPT=y in
that same file implies CONFIG_PREEMPT_RCU=y.  Therefore, delete the
CONFIG_TREE_PREEMPT_RCU=y line.

The reason is as follows:

In kernel/rcu/Kconfig, we have
config PREEMPT_RCU
        bool
        default y if PREEMPTION

https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt says,
"The default value is only assigned to the config symbol if no other value
 was set by the user (via the input prompt above)."
there is no prompt in config PREEMPT_RCU entry, so we are guaranteed to
get CONFIG_PREEMPT_RCU=y when CONFIG_PREEMPT is present.

2. RCU_CPU_STALL_INFO
Referencing files: arch/xtensa/configs/nommu_kc705_defconfig

The old Kconfig option RCU_CPU_STALL_INFO was removed by commit
75c27f11 ("rcu: Remove CONFIG_RCU_CPU_STALL_INFO"), and the kernel
now acts as if this Kconfig option was unconditionally enabled.

3. RCU_NOCB_CPU_ALL
Referencing files:
Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst

This is an old snapshot of the code. I update this from the real
rcu_prepare_for_idle() function in kernel/rcu/tree_plugin.h.
This change was tested by invoking "make htmldocs".

4. RCU_TORTURE_TESTS
Referencing files: kernel/rcu/rcutorture.c

Forward-progress checking conflicts with CPU-stall testing, so we should
complain at "modprobe rcutorture" when both are enabled.
Signed-off-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 13bc8fa8
...@@ -202,49 +202,44 @@ newly arrived RCU callbacks against future grace periods: ...@@ -202,49 +202,44 @@ newly arrived RCU callbacks against future grace periods:
1 static void rcu_prepare_for_idle(void) 1 static void rcu_prepare_for_idle(void)
2 { 2 {
3 bool needwake; 3 bool needwake;
4 struct rcu_data *rdp; 4 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
5 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); 5 struct rcu_node *rnp;
6 struct rcu_node *rnp; 6 int tne;
7 struct rcu_state *rsp; 7
8 int tne; 8 lockdep_assert_irqs_disabled();
9 9 if (rcu_rdp_is_offloaded(rdp))
10 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL) || 10 return;
11 rcu_is_nocb_cpu(smp_processor_id())) 11
12 return; 12 /* Handle nohz enablement switches conservatively. */
13 tne = READ_ONCE(tick_nohz_active); 13 tne = READ_ONCE(tick_nohz_active);
14 if (tne != rdtp->tick_nohz_enabled_snap) { 14 if (tne != rdp->tick_nohz_enabled_snap) {
15 if (rcu_cpu_has_callbacks(NULL)) 15 if (!rcu_segcblist_empty(&rdp->cblist))
16 invoke_rcu_core(); 16 invoke_rcu_core(); /* force nohz to see update. */
17 rdtp->tick_nohz_enabled_snap = tne; 17 rdp->tick_nohz_enabled_snap = tne;
18 return; 18 return;
19 } 19 }
20 if (!tne) 20 if (!tne)
21 return; 21 return;
22 if (rdtp->all_lazy && 22
23 rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) { 23 /*
24 rdtp->all_lazy = false; 24 * If we have not yet accelerated this jiffy, accelerate all
25 rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted; 25 * callbacks on this CPU.
26 invoke_rcu_core(); 26 */
27 return; 27 if (rdp->last_accelerate == jiffies)
28 } 28 return;
29 if (rdtp->last_accelerate == jiffies) 29 rdp->last_accelerate = jiffies;
30 return; 30 if (rcu_segcblist_pend_cbs(&rdp->cblist)) {
31 rdtp->last_accelerate = jiffies; 31 rnp = rdp->mynode;
32 for_each_rcu_flavor(rsp) { 32 raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
33 rdp = this_cpu_ptr(rsp->rda); 33 needwake = rcu_accelerate_cbs(rnp, rdp);
34 if (rcu_segcblist_pend_cbs(&rdp->cblist)) 34 raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
35 continue; 35 if (needwake)
36 rnp = rdp->mynode; 36 rcu_gp_kthread_wake();
37 raw_spin_lock_rcu_node(rnp); 37 }
38 needwake = rcu_accelerate_cbs(rsp, rnp, rdp); 38 }
39 raw_spin_unlock_rcu_node(rnp);
40 if (needwake)
41 rcu_gp_kthread_wake(rsp);
42 }
43 }
But the only part of ``rcu_prepare_for_idle()`` that really matters for But the only part of ``rcu_prepare_for_idle()`` that really matters for
this discussion are lines 37–39. We will therefore abbreviate this this discussion are lines 32–34. We will therefore abbreviate this
function as follows: function as follows:
.. kernel-figure:: rcu_node-lock.svg .. kernel-figure:: rcu_node-lock.svg
......
...@@ -5,7 +5,6 @@ CONFIG_BSD_PROCESS_ACCT=y ...@@ -5,7 +5,6 @@ CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_BSD_PROCESS_ACCT_V3=y
CONFIG_AUDIT=y CONFIG_AUDIT=y
CONFIG_AUDITSYSCALL=y CONFIG_AUDITSYSCALL=y
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_RCU_TRACE=y CONFIG_RCU_TRACE=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
......
...@@ -119,7 +119,6 @@ CONFIG_DEBUG_SPINLOCK=y ...@@ -119,7 +119,6 @@ CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_ATOMIC_SLEEP=y CONFIG_DEBUG_ATOMIC_SLEEP=y
CONFIG_STACKTRACE=y CONFIG_STACKTRACE=y
# CONFIG_RCU_CPU_STALL_INFO is not set
CONFIG_RCU_TRACE=y CONFIG_RCU_TRACE=y
# CONFIG_FTRACE is not set # CONFIG_FTRACE is not set
# CONFIG_LD_NO_RELAX is not set # CONFIG_LD_NO_RELAX is not set
......
...@@ -2449,7 +2449,7 @@ static int __init rcu_torture_fwd_prog_init(void) ...@@ -2449,7 +2449,7 @@ static int __init rcu_torture_fwd_prog_init(void)
} }
if (stall_cpu > 0) { if (stall_cpu > 0) {
VERBOSE_TOROUT_STRING("rcu_torture_fwd_prog_init: Disabled, conflicts with CPU-stall testing"); VERBOSE_TOROUT_STRING("rcu_torture_fwd_prog_init: Disabled, conflicts with CPU-stall testing");
if (IS_MODULE(CONFIG_RCU_TORTURE_TESTS)) if (IS_MODULE(CONFIG_RCU_TORTURE_TEST))
return -EINVAL; /* In module, can fail back to user. */ return -EINVAL; /* In module, can fail back to user. */
WARN_ON(1); /* Make sure rcutorture notices conflict. */ WARN_ON(1); /* Make sure rcutorture notices conflict. */
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment