Skip to content

Commit b3e627d

Browse files
Lai Jiangshanpaulmckrcu
authored andcommitted
rcu: Make PREEMPT_RCU be a modifier to TREE_RCU
Currently PREEMPT_RCU and TREE_RCU are mutually exclusive Kconfig options. But PREEMPT_RCU actually specifies a kind of TREE_RCU, namely a preemptible TREE_RCU. This commit therefore makes PREEMPT_RCU be a modifer to the TREE_RCU Kconfig option. This has the benefit of simplifying several of the #if expressions that formerly needed to check both, but now need only check one or the other. Signed-off-by: Lai Jiangshan <[email protected]> Signed-off-by: Lai Jiangshan <[email protected]> Reviewed-by: Joel Fernandes (Google) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 03bd298 commit b3e627d

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

include/linux/rcupdate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ do { \
167167
* TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
168168
*/
169169

170-
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
170+
#if defined(CONFIG_TREE_RCU)
171171
#include <linux/rcutree.h>
172172
#elif defined(CONFIG_TINY_RCU)
173173
#include <linux/rcutiny.h>
@@ -601,7 +601,7 @@ do { \
601601
* read-side critical section that would block in a !PREEMPT kernel.
602602
* But if you want the full story, read on!
603603
*
604-
* In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
604+
* In non-preemptible RCU implementations (pure TREE_RCU and TINY_RCU),
605605
* it is illegal to block while in an RCU read-side critical section.
606606
* In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
607607
* kernel builds, RCU read-side critical sections may be preempted,

include/trace/events/rcu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TRACE_EVENT(rcu_utilization,
4141
TP_printk("%s", __entry->s)
4242
);
4343

44-
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
44+
#if defined(CONFIG_TREE_RCU)
4545

4646
/*
4747
* Tracepoint for grace-period events. Takes a string identifying the
@@ -432,7 +432,7 @@ TRACE_EVENT_RCU(rcu_fqs,
432432
__entry->cpu, __entry->qsevent)
433433
);
434434

435-
#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) */
435+
#endif /* #if defined(CONFIG_TREE_RCU) */
436436

437437
/*
438438
* Tracepoint for dyntick-idle entry/exit events. These take a string

kernel/rcu/Kconfig

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ menu "RCU Subsystem"
77

88
config TREE_RCU
99
bool
10-
default y if !PREEMPTION && SMP
10+
default y if SMP
1111
help
1212
This option selects the RCU implementation that is
1313
designed for very large SMP system with hundreds or
@@ -17,6 +17,7 @@ config TREE_RCU
1717
config PREEMPT_RCU
1818
bool
1919
default y if PREEMPTION
20+
select TREE_RCU
2021
help
2122
This option selects the RCU implementation that is
2223
designed for very large SMP systems with hundreds or
@@ -78,21 +79,21 @@ config TASKS_RCU
7879
user-mode execution as quiescent states.
7980

8081
config RCU_STALL_COMMON
81-
def_bool ( TREE_RCU || PREEMPT_RCU )
82+
def_bool TREE_RCU
8283
help
8384
This option enables RCU CPU stall code that is common between
8485
the TINY and TREE variants of RCU. The purpose is to allow
8586
the tiny variants to disable RCU CPU stall warnings, while
8687
making these warnings mandatory for the tree variants.
8788

8889
config RCU_NEED_SEGCBLIST
89-
def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU )
90+
def_bool ( TREE_RCU || TREE_SRCU )
9091

9192
config RCU_FANOUT
9293
int "Tree-based hierarchical RCU fanout value"
9394
range 2 64 if 64BIT
9495
range 2 32 if !64BIT
95-
depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
96+
depends on TREE_RCU && RCU_EXPERT
9697
default 64 if 64BIT
9798
default 32 if !64BIT
9899
help
@@ -112,7 +113,7 @@ config RCU_FANOUT_LEAF
112113
int "Tree-based hierarchical RCU leaf-level fanout value"
113114
range 2 64 if 64BIT
114115
range 2 32 if !64BIT
115-
depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
116+
depends on TREE_RCU && RCU_EXPERT
116117
default 16
117118
help
118119
This option controls the leaf-level fanout of hierarchical
@@ -187,7 +188,7 @@ config RCU_BOOST_DELAY
187188

188189
config RCU_NOCB_CPU
189190
bool "Offload RCU callback processing from boot-selected CPUs"
190-
depends on TREE_RCU || PREEMPT_RCU
191+
depends on TREE_RCU
191192
depends on RCU_EXPERT || NO_HZ_FULL
192193
default n
193194
help

kernel/rcu/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ obj-$(CONFIG_TINY_SRCU) += srcutiny.o
99
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
1010
obj-$(CONFIG_RCU_PERF_TEST) += rcuperf.o
1111
obj-$(CONFIG_TREE_RCU) += tree.o
12-
obj-$(CONFIG_PREEMPT_RCU) += tree.o
1312
obj-$(CONFIG_TINY_RCU) += tiny.o
1413
obj-$(CONFIG_RCU_NEED_SEGCBLIST) += rcu_segcblist.o

kernel/rcu/rcu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ enum rcutorture_type {
454454
INVALID_RCU_FLAVOR
455455
};
456456

457-
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
457+
#if defined(CONFIG_TREE_RCU)
458458
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
459459
unsigned long *gp_seq);
460460
void do_trace_rcu_torture_read(const char *rcutorturename,

kernel/rcu/update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ struct debug_obj_descr rcuhead_debug_descr = {
435435
EXPORT_SYMBOL_GPL(rcuhead_debug_descr);
436436
#endif /* #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD */
437437

438-
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) || defined(CONFIG_RCU_TRACE)
438+
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_RCU_TRACE)
439439
void do_trace_rcu_torture_read(const char *rcutorturename, struct rcu_head *rhp,
440440
unsigned long secs,
441441
unsigned long c_old, unsigned long c)

kernel/sysctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ static struct ctl_table kern_table[] = {
12681268
.proc_handler = proc_do_static_key,
12691269
},
12701270
#endif
1271-
#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
1271+
#if defined(CONFIG_TREE_RCU)
12721272
{
12731273
.procname = "panic_on_rcu_stall",
12741274
.data = &sysctl_panic_on_rcu_stall,

0 commit comments

Comments
 (0)