xref: /linux/kernel/rcu/Kconfig (revision 40c1278aa7cd51d4f8627f7adc66aa73e01aff81)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
20af92d46SPaul E. McKenney#
30af92d46SPaul E. McKenney# RCU-related configuration options
40af92d46SPaul E. McKenney#
50af92d46SPaul E. McKenney
60af92d46SPaul E. McKenneymenu "RCU Subsystem"
70af92d46SPaul E. McKenney
80af92d46SPaul E. McKenneyconfig TREE_RCU
90af92d46SPaul E. McKenney	bool
10b3e627d3SLai Jiangshan	default y if SMP
110af92d46SPaul E. McKenney	help
120af92d46SPaul E. McKenney	  This option selects the RCU implementation that is
130af92d46SPaul E. McKenney	  designed for very large SMP system with hundreds or
140af92d46SPaul E. McKenney	  thousands of CPUs.  It also scales down nicely to
150af92d46SPaul E. McKenney	  smaller systems.
160af92d46SPaul E. McKenney
170af92d46SPaul E. McKenneyconfig PREEMPT_RCU
180af92d46SPaul E. McKenney	bool
1901b1d88bSThomas Gleixner	default y if PREEMPTION
20b3e627d3SLai Jiangshan	select TREE_RCU
210af92d46SPaul E. McKenney	help
220af92d46SPaul E. McKenney	  This option selects the RCU implementation that is
230af92d46SPaul E. McKenney	  designed for very large SMP systems with hundreds or
240af92d46SPaul E. McKenney	  thousands of CPUs, but for which real-time response
250af92d46SPaul E. McKenney	  is also required.  It also scales down nicely to
260af92d46SPaul E. McKenney	  smaller systems.
270af92d46SPaul E. McKenney
280af92d46SPaul E. McKenney	  Select this option if you are unsure.
290af92d46SPaul E. McKenney
300af92d46SPaul E. McKenneyconfig TINY_RCU
310af92d46SPaul E. McKenney	bool
3201b1d88bSThomas Gleixner	default y if !PREEMPTION && !SMP
330af92d46SPaul E. McKenney	help
340af92d46SPaul E. McKenney	  This option selects the RCU implementation that is
350af92d46SPaul E. McKenney	  designed for UP systems from which real-time response
360af92d46SPaul E. McKenney	  is not required.  This option greatly reduces the
370af92d46SPaul E. McKenney	  memory footprint of RCU.
380af92d46SPaul E. McKenney
390af92d46SPaul E. McKenneyconfig RCU_EXPERT
400af92d46SPaul E. McKenney	bool "Make expert-level adjustments to RCU configuration"
410af92d46SPaul E. McKenney	default n
420af92d46SPaul E. McKenney	help
430af92d46SPaul E. McKenney	  This option needs to be enabled if you wish to make
440af92d46SPaul E. McKenney	  expert-level adjustments to RCU configuration.  By default,
450af92d46SPaul E. McKenney	  no such adjustments can be made, which has the often-beneficial
460af92d46SPaul E. McKenney	  side-effect of preventing "make oldconfig" from asking you all
470af92d46SPaul E. McKenney	  sorts of detailed questions about how you would like numerous
480af92d46SPaul E. McKenney	  obscure RCU options to be set up.
490af92d46SPaul E. McKenney
500af92d46SPaul E. McKenney	  Say Y if you need to make expert-level adjustments to RCU.
510af92d46SPaul E. McKenney
520af92d46SPaul E. McKenney	  Say N if you are unsure.
530af92d46SPaul E. McKenney
540af92d46SPaul E. McKenneyconfig SRCU
550af92d46SPaul E. McKenney	bool
560af92d46SPaul E. McKenney	help
570af92d46SPaul E. McKenney	  This option selects the sleepable version of RCU. This version
580af92d46SPaul E. McKenney	  permits arbitrary sleeping or blocking within RCU read-side critical
590af92d46SPaul E. McKenney	  sections.
600af92d46SPaul E. McKenney
610af92d46SPaul E. McKenneyconfig TINY_SRCU
620af92d46SPaul E. McKenney	bool
630af92d46SPaul E. McKenney	default y if SRCU && TINY_RCU
640af92d46SPaul E. McKenney	help
650af92d46SPaul E. McKenney	  This option selects the single-CPU non-preemptible version of SRCU.
660af92d46SPaul E. McKenney
670af92d46SPaul E. McKenneyconfig TREE_SRCU
680af92d46SPaul E. McKenney	bool
690af92d46SPaul E. McKenney	default y if SRCU && !TINY_RCU
700af92d46SPaul E. McKenney	help
710af92d46SPaul E. McKenney	  This option selects the full-fledged version of SRCU.
720af92d46SPaul E. McKenney
735873b8a9SPaul E. McKenneyconfig TASKS_RCU_GENERIC
74d5f177d3SPaul E. McKenney	def_bool TASKS_RCU || TASKS_RUDE_RCU || TASKS_TRACE_RCU
755873b8a9SPaul E. McKenney	select SRCU
765873b8a9SPaul E. McKenney	help
775873b8a9SPaul E. McKenney	  This option enables generic infrastructure code supporting
785873b8a9SPaul E. McKenney	  task-based RCU implementations.  Not for manual selection.
795873b8a9SPaul E. McKenney
800af92d46SPaul E. McKenneyconfig TASKS_RCU
81835f14edSPaul E. McKenney	def_bool 0
82835f14edSPaul E. McKenney	select IRQ_WORK
830af92d46SPaul E. McKenney	help
840af92d46SPaul E. McKenney	  This option enables a task-based RCU implementation that uses
850af92d46SPaul E. McKenney	  only voluntary context switch (not preemption!), idle, and
865873b8a9SPaul E. McKenney	  user-mode execution as quiescent states.  Not for manual selection.
870af92d46SPaul E. McKenney
88c84aad76SPaul E. McKenneyconfig TASKS_RUDE_RCU
89c84aad76SPaul E. McKenney	def_bool 0
9046e861beSPaul E. McKenney	select IRQ_WORK
91c84aad76SPaul E. McKenney	help
92c84aad76SPaul E. McKenney	  This option enables a task-based RCU implementation that uses
93c84aad76SPaul E. McKenney	  only context switch (including preemption) and user-mode
94c84aad76SPaul E. McKenney	  execution as quiescent states.  It forces IPIs and context
95c84aad76SPaul E. McKenney	  switches on all online CPUs, including idle ones, so use
96c84aad76SPaul E. McKenney	  with caution.
97c84aad76SPaul E. McKenney
98*40c1278aSPaul E. McKenneyconfig FORCE_TASKS_TRACE_RCU
99*40c1278aSPaul E. McKenney	bool "Force selection of Tasks Trace RCU"
100*40c1278aSPaul E. McKenney	depends on RCU_EXPERT
101*40c1278aSPaul E. McKenney	select TASKS_TRACE_RCU
102*40c1278aSPaul E. McKenney	default n
103d5f177d3SPaul E. McKenney	help
104d5f177d3SPaul E. McKenney	  This option enables a task-based RCU implementation that uses
105d5f177d3SPaul E. McKenney	  explicit rcu_read_lock_trace() read-side markers, and allows
106*40c1278aSPaul E. McKenney	  these readers to appear in the idle loop as well as on the
107*40c1278aSPaul E. McKenney	  CPU hotplug code paths.  It can force IPIs on online CPUs,
108*40c1278aSPaul E. McKenney	  including idle ones, so use with caution.  Not for manual
109*40c1278aSPaul E. McKenney	  selection in most cases.
110*40c1278aSPaul E. McKenney
111*40c1278aSPaul E. McKenneyconfig TASKS_TRACE_RCU
112*40c1278aSPaul E. McKenney	bool
113*40c1278aSPaul E. McKenney	default n
114*40c1278aSPaul E. McKenney	select IRQ_WORK
115d5f177d3SPaul E. McKenney
1160af92d46SPaul E. McKenneyconfig RCU_STALL_COMMON
117b3e627d3SLai Jiangshan	def_bool TREE_RCU
1180af92d46SPaul E. McKenney	help
1190af92d46SPaul E. McKenney	  This option enables RCU CPU stall code that is common between
1200af92d46SPaul E. McKenney	  the TINY and TREE variants of RCU.  The purpose is to allow
1210af92d46SPaul E. McKenney	  the tiny variants to disable RCU CPU stall warnings, while
1220af92d46SPaul E. McKenney	  making these warnings mandatory for the tree variants.
1230af92d46SPaul E. McKenney
1240af92d46SPaul E. McKenneyconfig RCU_NEED_SEGCBLIST
1259b073de1SPaul E. McKenney	def_bool ( TREE_RCU || TREE_SRCU || TASKS_RCU_GENERIC )
1260af92d46SPaul E. McKenney
1270af92d46SPaul E. McKenneyconfig RCU_FANOUT
1280af92d46SPaul E. McKenney	int "Tree-based hierarchical RCU fanout value"
1290af92d46SPaul E. McKenney	range 2 64 if 64BIT
1300af92d46SPaul E. McKenney	range 2 32 if !64BIT
131b3e627d3SLai Jiangshan	depends on TREE_RCU && RCU_EXPERT
1320af92d46SPaul E. McKenney	default 64 if 64BIT
1330af92d46SPaul E. McKenney	default 32 if !64BIT
1340af92d46SPaul E. McKenney	help
1350af92d46SPaul E. McKenney	  This option controls the fanout of hierarchical implementations
1360af92d46SPaul E. McKenney	  of RCU, allowing RCU to work efficiently on machines with
1370af92d46SPaul E. McKenney	  large numbers of CPUs.  This value must be at least the fourth
1380af92d46SPaul E. McKenney	  root of NR_CPUS, which allows NR_CPUS to be insanely large.
1390af92d46SPaul E. McKenney	  The default value of RCU_FANOUT should be used for production
1400af92d46SPaul E. McKenney	  systems, but if you are stress-testing the RCU implementation
1410af92d46SPaul E. McKenney	  itself, small RCU_FANOUT values allow you to test large-system
1420af92d46SPaul E. McKenney	  code paths on small(er) systems.
1430af92d46SPaul E. McKenney
1440af92d46SPaul E. McKenney	  Select a specific number if testing RCU itself.
1450af92d46SPaul E. McKenney	  Take the default if unsure.
1460af92d46SPaul E. McKenney
1470af92d46SPaul E. McKenneyconfig RCU_FANOUT_LEAF
1480af92d46SPaul E. McKenney	int "Tree-based hierarchical RCU leaf-level fanout value"
149dc126918SPaul E. McKenney	range 2 64 if 64BIT && !RCU_STRICT_GRACE_PERIOD
150dc126918SPaul E. McKenney	range 2 32 if !64BIT && !RCU_STRICT_GRACE_PERIOD
151dc126918SPaul E. McKenney	range 2 3 if RCU_STRICT_GRACE_PERIOD
152b3e627d3SLai Jiangshan	depends on TREE_RCU && RCU_EXPERT
153dc126918SPaul E. McKenney	default 16 if !RCU_STRICT_GRACE_PERIOD
154dc126918SPaul E. McKenney	default 2 if RCU_STRICT_GRACE_PERIOD
1550af92d46SPaul E. McKenney	help
1560af92d46SPaul E. McKenney	  This option controls the leaf-level fanout of hierarchical
1570af92d46SPaul E. McKenney	  implementations of RCU, and allows trading off cache misses
1580af92d46SPaul E. McKenney	  against lock contention.  Systems that synchronize their
1590af92d46SPaul E. McKenney	  scheduling-clock interrupts for energy-efficiency reasons will
1600af92d46SPaul E. McKenney	  want the default because the smaller leaf-level fanout keeps
1610af92d46SPaul E. McKenney	  lock contention levels acceptably low.  Very large systems
1620af92d46SPaul E. McKenney	  (hundreds or thousands of CPUs) will instead want to set this
1630af92d46SPaul E. McKenney	  value to the maximum value possible in order to reduce the
1640af92d46SPaul E. McKenney	  number of cache misses incurred during RCU's grace-period
1650af92d46SPaul E. McKenney	  initialization.  These systems tend to run CPU-bound, and thus
1660af92d46SPaul E. McKenney	  are not helped by synchronized interrupts, and thus tend to
1670af92d46SPaul E. McKenney	  skew them, which reduces lock contention enough that large
1680af92d46SPaul E. McKenney	  leaf-level fanouts work well.  That said, setting leaf-level
1690af92d46SPaul E. McKenney	  fanout to a large number will likely cause problematic
1700af92d46SPaul E. McKenney	  lock contention on the leaf-level rcu_node structures unless
1710af92d46SPaul E. McKenney	  you boot with the skew_tick kernel parameter.
1720af92d46SPaul E. McKenney
1730af92d46SPaul E. McKenney	  Select a specific number if testing RCU itself.
1740af92d46SPaul E. McKenney
1750af92d46SPaul E. McKenney	  Select the maximum permissible value for large systems, but
1760af92d46SPaul E. McKenney	  please understand that you may also need to set the skew_tick
1770af92d46SPaul E. McKenney	  kernel boot parameter to avoid contention on the rcu_node
1780af92d46SPaul E. McKenney	  structure's locks.
1790af92d46SPaul E. McKenney
1800af92d46SPaul E. McKenney	  Take the default if unsure.
1810af92d46SPaul E. McKenney
1820af92d46SPaul E. McKenneyconfig RCU_BOOST
1830af92d46SPaul E. McKenney	bool "Enable RCU priority boosting"
1842341bc4aSSebastian Andrzej Siewior	depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT
1852341bc4aSSebastian Andrzej Siewior	default y if PREEMPT_RT
1860af92d46SPaul E. McKenney	help
1870af92d46SPaul E. McKenney	  This option boosts the priority of preempted RCU readers that
1880af92d46SPaul E. McKenney	  block the current preemptible RCU grace period for too long.
1890af92d46SPaul E. McKenney	  This option also prevents heavy loads from blocking RCU
1908c1cf2daSPaul E. McKenney	  callback invocation.
1910af92d46SPaul E. McKenney
1920af92d46SPaul E. McKenney	  Say Y here if you are working with real-time apps or heavy loads
1930af92d46SPaul E. McKenney	  Say N here if you are unsure.
1940af92d46SPaul E. McKenney
1950af92d46SPaul E. McKenneyconfig RCU_BOOST_DELAY
1960af92d46SPaul E. McKenney	int "Milliseconds to delay boosting after RCU grace-period start"
1970af92d46SPaul E. McKenney	range 0 3000
1980af92d46SPaul E. McKenney	depends on RCU_BOOST
1990af92d46SPaul E. McKenney	default 500
2000af92d46SPaul E. McKenney	help
2010af92d46SPaul E. McKenney	  This option specifies the time to wait after the beginning of
2020af92d46SPaul E. McKenney	  a given grace period before priority-boosting preempted RCU
2030af92d46SPaul E. McKenney	  readers blocking that grace period.  Note that any RCU reader
2040af92d46SPaul E. McKenney	  blocking an expedited RCU grace period is boosted immediately.
2050af92d46SPaul E. McKenney
2060af92d46SPaul E. McKenney	  Accept the default if unsure.
2070af92d46SPaul E. McKenney
2080af92d46SPaul E. McKenneyconfig RCU_NOCB_CPU
2090af92d46SPaul E. McKenney	bool "Offload RCU callback processing from boot-selected CPUs"
210b3e627d3SLai Jiangshan	depends on TREE_RCU
2110af92d46SPaul E. McKenney	depends on RCU_EXPERT || NO_HZ_FULL
2120af92d46SPaul E. McKenney	default n
2130af92d46SPaul E. McKenney	help
2140af92d46SPaul E. McKenney	  Use this option to reduce OS jitter for aggressive HPC or
2150af92d46SPaul E. McKenney	  real-time workloads.	It can also be used to offload RCU
2160af92d46SPaul E. McKenney	  callback invocation to energy-efficient CPUs in battery-powered
217a3941517SNeeraj Upadhyay	  asymmetric multiprocessors.  The price of this reduced jitter
218a3941517SNeeraj Upadhyay	  is that the overhead of call_rcu() increases and that some
219a3941517SNeeraj Upadhyay	  workloads will incur significant increases in context-switch
220a3941517SNeeraj Upadhyay	  rates.
2210af92d46SPaul E. McKenney
2228c1cf2daSPaul E. McKenney	  This option offloads callback invocation from the set of CPUs
2238c1cf2daSPaul E. McKenney	  specified at boot time by the rcu_nocbs parameter.  For each
2248c1cf2daSPaul E. McKenney	  such CPU, a kthread ("rcuox/N") will be created to invoke
2258c1cf2daSPaul E. McKenney	  callbacks, where the "N" is the CPU being offloaded, and where
226a3941517SNeeraj Upadhyay	  the "x" is "p" for RCU-preempt (PREEMPTION kernels) and "s" for
227a3941517SNeeraj Upadhyay	  RCU-sched (!PREEMPTION kernels).  Nothing prevents this kthread
228a3941517SNeeraj Upadhyay	  from running on the specified CPUs, but (1) the kthreads may be
229a3941517SNeeraj Upadhyay	  preempted between each callback, and (2) affinity or cgroups can
230a3941517SNeeraj Upadhyay	  be used to force the kthreads to run on whatever set of CPUs is
231a3941517SNeeraj Upadhyay	  desired.
2320af92d46SPaul E. McKenney
233a3941517SNeeraj Upadhyay	  Say Y here if you need reduced OS jitter, despite added overhead.
2340af92d46SPaul E. McKenney	  Say N here if you are unsure.
2350af92d46SPaul E. McKenney
2369ae58d7bSPaul E. McKenneyconfig TASKS_TRACE_RCU_READ_MB
2379ae58d7bSPaul E. McKenney	bool "Tasks Trace RCU readers use memory barriers in user and idle"
238*40c1278aSPaul E. McKenney	depends on RCU_EXPERT && TASKS_TRACE_RCU
2399ae58d7bSPaul E. McKenney	default PREEMPT_RT || NR_CPUS < 8
2409ae58d7bSPaul E. McKenney	help
2419ae58d7bSPaul E. McKenney	  Use this option to further reduce the number of IPIs sent
2429ae58d7bSPaul E. McKenney	  to CPUs executing in userspace or idle during tasks trace
2439ae58d7bSPaul E. McKenney	  RCU grace periods.  Given that a reasonable setting of
2449ae58d7bSPaul E. McKenney	  the rcupdate.rcu_task_ipi_delay kernel boot parameter
2459ae58d7bSPaul E. McKenney	  eliminates such IPIs for many workloads, proper setting
2469ae58d7bSPaul E. McKenney	  of this Kconfig option is important mostly for aggressive
2479ae58d7bSPaul E. McKenney	  real-time installations and for battery-powered devices,
2489ae58d7bSPaul E. McKenney	  hence the default chosen above.
2499ae58d7bSPaul E. McKenney
2509ae58d7bSPaul E. McKenney	  Say Y here if you hate IPIs.
2519ae58d7bSPaul E. McKenney	  Say N here if you hate read-side memory barriers.
2529ae58d7bSPaul E. McKenney	  Take the default if you are unsure.
2539ae58d7bSPaul E. McKenney
2540af92d46SPaul E. McKenneyendmenu # "RCU Subsystem"
255