Commit b3e627d3 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Paul E. McKenney
Browse files

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: default avatarLai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: default avatarLai Jiangshan <jiangshanlai@gmail.com>
Reviewed-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 03bd2983
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -167,7 +167,7 @@ do { \
 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
 */
 */


#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
#if defined(CONFIG_TREE_RCU)
#include <linux/rcutree.h>
#include <linux/rcutree.h>
#elif defined(CONFIG_TINY_RCU)
#elif defined(CONFIG_TINY_RCU)
#include <linux/rcutiny.h>
#include <linux/rcutiny.h>
@@ -601,7 +601,7 @@ do { \
 * read-side critical section that would block in a !PREEMPT kernel.
 * read-side critical section that would block in a !PREEMPT kernel.
 * But if you want the full story, read on!
 * But if you want the full story, read on!
 *
 *
 * In non-preemptible RCU implementations (TREE_RCU and TINY_RCU),
 * In non-preemptible RCU implementations (pure TREE_RCU and TINY_RCU),
 * it is illegal to block while in an RCU read-side critical section.
 * it is illegal to block while in an RCU read-side critical section.
 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
 * In preemptible RCU implementations (PREEMPT_RCU) in CONFIG_PREEMPTION
 * kernel builds, RCU read-side critical sections may be preempted,
 * kernel builds, RCU read-side critical sections may be preempted,
+2 −2
Original line number Original line Diff line number Diff line
@@ -41,7 +41,7 @@ TRACE_EVENT(rcu_utilization,
	TP_printk("%s", __entry->s)
	TP_printk("%s", __entry->s)
);
);


#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
#if defined(CONFIG_TREE_RCU)


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


#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU) */
#endif /* #if defined(CONFIG_TREE_RCU) */


/*
/*
 * Tracepoint for dyntick-idle entry/exit events.  These take a string
 * Tracepoint for dyntick-idle entry/exit events.  These take a string
+7 −6
Original line number Original line Diff line number Diff line
@@ -7,7 +7,7 @@ menu "RCU Subsystem"


config TREE_RCU
config TREE_RCU
	bool
	bool
	default y if !PREEMPTION && SMP
	default y if SMP
	help
	help
	  This option selects the RCU implementation that is
	  This option selects the RCU implementation that is
	  designed for very large SMP system with hundreds or
	  designed for very large SMP system with hundreds or
@@ -17,6 +17,7 @@ config TREE_RCU
config PREEMPT_RCU
config PREEMPT_RCU
	bool
	bool
	default y if PREEMPTION
	default y if PREEMPTION
	select TREE_RCU
	help
	help
	  This option selects the RCU implementation that is
	  This option selects the RCU implementation that is
	  designed for very large SMP systems with hundreds or
	  designed for very large SMP systems with hundreds or
@@ -78,7 +79,7 @@ config TASKS_RCU
	  user-mode execution as quiescent states.
	  user-mode execution as quiescent states.


config RCU_STALL_COMMON
config RCU_STALL_COMMON
	def_bool ( TREE_RCU || PREEMPT_RCU )
	def_bool TREE_RCU
	help
	help
	  This option enables RCU CPU stall code that is common between
	  This option enables RCU CPU stall code that is common between
	  the TINY and TREE variants of RCU.  The purpose is to allow
	  the TINY and TREE variants of RCU.  The purpose is to allow
@@ -86,13 +87,13 @@ config RCU_STALL_COMMON
	  making these warnings mandatory for the tree variants.
	  making these warnings mandatory for the tree variants.


config RCU_NEED_SEGCBLIST
config RCU_NEED_SEGCBLIST
	def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU )
	def_bool ( TREE_RCU || TREE_SRCU )


config RCU_FANOUT
config RCU_FANOUT
	int "Tree-based hierarchical RCU fanout value"
	int "Tree-based hierarchical RCU fanout value"
	range 2 64 if 64BIT
	range 2 64 if 64BIT
	range 2 32 if !64BIT
	range 2 32 if !64BIT
	depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
	depends on TREE_RCU && RCU_EXPERT
	default 64 if 64BIT
	default 64 if 64BIT
	default 32 if !64BIT
	default 32 if !64BIT
	help
	help
@@ -112,7 +113,7 @@ config RCU_FANOUT_LEAF
	int "Tree-based hierarchical RCU leaf-level fanout value"
	int "Tree-based hierarchical RCU leaf-level fanout value"
	range 2 64 if 64BIT
	range 2 64 if 64BIT
	range 2 32 if !64BIT
	range 2 32 if !64BIT
	depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
	depends on TREE_RCU && RCU_EXPERT
	default 16
	default 16
	help
	help
	  This option controls the leaf-level fanout of hierarchical
	  This option controls the leaf-level fanout of hierarchical
@@ -187,7 +188,7 @@ config RCU_BOOST_DELAY


config RCU_NOCB_CPU
config RCU_NOCB_CPU
	bool "Offload RCU callback processing from boot-selected CPUs"
	bool "Offload RCU callback processing from boot-selected CPUs"
	depends on TREE_RCU || PREEMPT_RCU
	depends on TREE_RCU
	depends on RCU_EXPERT || NO_HZ_FULL
	depends on RCU_EXPERT || NO_HZ_FULL
	default n
	default n
	help
	help
+0 −1
Original line number Original line Diff line number Diff line
@@ -9,6 +9,5 @@ obj-$(CONFIG_TINY_SRCU) += srcutiny.o
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
obj-$(CONFIG_RCU_PERF_TEST) += rcuperf.o
obj-$(CONFIG_RCU_PERF_TEST) += rcuperf.o
obj-$(CONFIG_TREE_RCU) += tree.o
obj-$(CONFIG_TREE_RCU) += tree.o
obj-$(CONFIG_PREEMPT_RCU) += tree.o
obj-$(CONFIG_TINY_RCU) += tiny.o
obj-$(CONFIG_TINY_RCU) += tiny.o
obj-$(CONFIG_RCU_NEED_SEGCBLIST) += rcu_segcblist.o
obj-$(CONFIG_RCU_NEED_SEGCBLIST) += rcu_segcblist.o
+1 −1
Original line number Original line Diff line number Diff line
@@ -454,7 +454,7 @@ enum rcutorture_type {
	INVALID_RCU_FLAVOR
	INVALID_RCU_FLAVOR
};
};


#if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
#if defined(CONFIG_TREE_RCU)
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
void rcutorture_get_gp_data(enum rcutorture_type test_type, int *flags,
			    unsigned long *gp_seq);
			    unsigned long *gp_seq);
void do_trace_rcu_torture_read(const char *rcutorturename,
void do_trace_rcu_torture_read(const char *rcutorturename,
Loading