Skip to content

Commit 3ac8587

Browse files
zhouzhouyi-hubpaulmckrcu
authored andcommitted
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 75c27f1 ("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: Zhouyi Zhou <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 13bc8fa commit 3ac8587

File tree

4 files changed

+33
-40
lines changed

4 files changed

+33
-40
lines changed

Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.rst

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -202,49 +202,44 @@ newly arrived RCU callbacks against future grace periods:
202202
1 static void rcu_prepare_for_idle(void)
203203
2 {
204204
3 bool needwake;
205-
4 struct rcu_data *rdp;
206-
5 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
207-
6 struct rcu_node *rnp;
208-
7 struct rcu_state *rsp;
209-
8 int tne;
210-
9
211-
10 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL) ||
212-
11 rcu_is_nocb_cpu(smp_processor_id()))
213-
12 return;
205+
4 struct rcu_data *rdp = this_cpu_ptr(&rcu_data);
206+
5 struct rcu_node *rnp;
207+
6 int tne;
208+
7
209+
8 lockdep_assert_irqs_disabled();
210+
9 if (rcu_rdp_is_offloaded(rdp))
211+
10 return;
212+
11
213+
12 /* Handle nohz enablement switches conservatively. */
214214
13 tne = READ_ONCE(tick_nohz_active);
215-
14 if (tne != rdtp->tick_nohz_enabled_snap) {
216-
15 if (rcu_cpu_has_callbacks(NULL))
217-
16 invoke_rcu_core();
218-
17 rdtp->tick_nohz_enabled_snap = tne;
215+
14 if (tne != rdp->tick_nohz_enabled_snap) {
216+
15 if (!rcu_segcblist_empty(&rdp->cblist))
217+
16 invoke_rcu_core(); /* force nohz to see update. */
218+
17 rdp->tick_nohz_enabled_snap = tne;
219219
18 return;
220-
19 }
220+
19 }
221221
20 if (!tne)
222222
21 return;
223-
22 if (rdtp->all_lazy &&
224-
23 rdtp->nonlazy_posted != rdtp->nonlazy_posted_snap) {
225-
24 rdtp->all_lazy = false;
226-
25 rdtp->nonlazy_posted_snap = rdtp->nonlazy_posted;
227-
26 invoke_rcu_core();
228-
27 return;
229-
28 }
230-
29 if (rdtp->last_accelerate == jiffies)
231-
30 return;
232-
31 rdtp->last_accelerate = jiffies;
233-
32 for_each_rcu_flavor(rsp) {
234-
33 rdp = this_cpu_ptr(rsp->rda);
235-
34 if (rcu_segcblist_pend_cbs(&rdp->cblist))
236-
35 continue;
237-
36 rnp = rdp->mynode;
238-
37 raw_spin_lock_rcu_node(rnp);
239-
38 needwake = rcu_accelerate_cbs(rsp, rnp, rdp);
240-
39 raw_spin_unlock_rcu_node(rnp);
241-
40 if (needwake)
242-
41 rcu_gp_kthread_wake(rsp);
243-
42 }
244-
43 }
223+
22
224+
23 /*
225+
24 * If we have not yet accelerated this jiffy, accelerate all
226+
25 * callbacks on this CPU.
227+
26 */
228+
27 if (rdp->last_accelerate == jiffies)
229+
28 return;
230+
29 rdp->last_accelerate = jiffies;
231+
30 if (rcu_segcblist_pend_cbs(&rdp->cblist)) {
232+
31 rnp = rdp->mynode;
233+
32 raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */
234+
33 needwake = rcu_accelerate_cbs(rnp, rdp);
235+
34 raw_spin_unlock_rcu_node(rnp); /* irqs remain disabled. */
236+
35 if (needwake)
237+
36 rcu_gp_kthread_wake();
238+
37 }
239+
38 }
245240

246241
But the only part of ``rcu_prepare_for_idle()`` that really matters for
247-
this discussion are lines 37–39. We will therefore abbreviate this
242+
this discussion are lines 32–34. We will therefore abbreviate this
248243
function as follows:
249244

250245
.. kernel-figure:: rcu_node-lock.svg

arch/sh/configs/sdk7786_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ CONFIG_BSD_PROCESS_ACCT=y
55
CONFIG_BSD_PROCESS_ACCT_V3=y
66
CONFIG_AUDIT=y
77
CONFIG_AUDITSYSCALL=y
8-
CONFIG_TREE_PREEMPT_RCU=y
98
CONFIG_RCU_TRACE=y
109
CONFIG_IKCONFIG=y
1110
CONFIG_IKCONFIG_PROC=y

arch/xtensa/configs/nommu_kc705_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ CONFIG_DEBUG_SPINLOCK=y
119119
CONFIG_DEBUG_MUTEXES=y
120120
CONFIG_DEBUG_ATOMIC_SLEEP=y
121121
CONFIG_STACKTRACE=y
122-
# CONFIG_RCU_CPU_STALL_INFO is not set
123122
CONFIG_RCU_TRACE=y
124123
# CONFIG_FTRACE is not set
125124
# CONFIG_LD_NO_RELAX is not set

kernel/rcu/rcutorture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2449,7 +2449,7 @@ static int __init rcu_torture_fwd_prog_init(void)
24492449
}
24502450
if (stall_cpu > 0) {
24512451
VERBOSE_TOROUT_STRING("rcu_torture_fwd_prog_init: Disabled, conflicts with CPU-stall testing");
2452-
if (IS_MODULE(CONFIG_RCU_TORTURE_TESTS))
2452+
if (IS_MODULE(CONFIG_RCU_TORTURE_TEST))
24532453
return -EINVAL; /* In module, can fail back to user. */
24542454
WARN_ON(1); /* Make sure rcutorture notices conflict. */
24552455
return 0;

0 commit comments

Comments
 (0)