Skip to content

Commit 21bbb39

Browse files
paulmckLinus Torvalds
authored andcommitted
rcu: move PREEMPT_RCU config option back under PREEMPT
The original preemptible-RCU patch put the choice between classic and preemptible RCU into kernel/Kconfig.preempt, which resulted in build failures on machines not supporting CONFIG_PREEMPT. This choice was therefore moved to init/Kconfig, which worked, but placed the choice between classic and preemptible RCU at the top level, a very obtuse choice indeed. This patch changes from the Kconfig "choice" mechanism to a pair of booleans, only one of which (CONFIG_PREEMPT_RCU) is user-visible, and is located in kernel/Kconfig.preempt, where one would expect it to be. The other (CONFIG_CLASSIC_RCU) is in init/Kconfig so that it is available to all architectures, hopefully avoiding build breakage. Thanks to Roman Zippel for suggesting this approach. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Dipankar Sarma <dipankar@in.ibm.com> Cc: Josh Triplett <josh@freedesktop.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent f47831f commit 21bbb39

2 files changed

Lines changed: 18 additions & 31 deletions

File tree

‎init/Kconfig‎

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -865,38 +865,10 @@ source "block/Kconfig"
865865
config PREEMPT_NOTIFIERS
866866
bool
867867

868-
choice
869-
prompt "RCU implementation type:"
870-
default CLASSIC_RCU
871-
help
872-
This allows you to choose either the classic RCU implementation
873-
that is designed for best read-side performance on non-realtime
874-
systems, or the preemptible RCU implementation for best latency
875-
on realtime systems. Note that some kernel preemption modes
876-
will restrict your choice.
877-
878-
Select the default if you are unsure.
879-
880868
config CLASSIC_RCU
881-
bool "Classic RCU"
869+
def_bool !PREEMPT_RCU
882870
help
883871
This option selects the classic RCU implementation that is
884872
designed for best read-side performance on non-realtime
885-
systems.
886-
887-
Say Y if you are unsure.
888-
889-
config PREEMPT_RCU
890-
bool "Preemptible RCU"
891-
depends on PREEMPT
892-
help
893-
This option reduces the latency of the kernel by making certain
894-
RCU sections preemptible. Normally RCU code is non-preemptible, if
895-
this option is selected then read-only RCU sections become
896-
preemptible. This helps latency, but may expose bugs due to
897-
now-naive assumptions about each RCU read-side critical section
898-
remaining on a given CPU through its execution.
899-
900-
Say N if you are unsure.
901-
902-
endchoice
873+
systems. Classic RCU is the default. Note that the
874+
PREEMPT_RCU symbol is used to select/deselect this option.

‎kernel/Kconfig.preempt‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,23 @@ config PREEMPT
5252

5353
endchoice
5454

55+
config PREEMPT_RCU
56+
bool "Preemptible RCU"
57+
depends on PREEMPT
58+
default n
59+
help
60+
This option reduces the latency of the kernel by making certain
61+
RCU sections preemptible. Normally RCU code is non-preemptible, if
62+
this option is selected then read-only RCU sections become
63+
preemptible. This helps latency, but may expose bugs due to
64+
now-naive assumptions about each RCU read-side critical section
65+
remaining on a given CPU through its execution.
66+
67+
Say N if you are unsure.
68+
5569
config RCU_TRACE
5670
bool "Enable tracing for RCU - currently stats in debugfs"
71+
depends on PREEMPT_RCU
5772
select DEBUG_FS
5873
default y
5974
help

0 commit comments

Comments
 (0)