0001 # SPDX-License-Identifier: GPL-2.0-only
0002 #
0003 # RCU-related configuration options
0004 #
0005
0006 menu "RCU Subsystem"
0007
0008 config TREE_RCU
0009 bool
0010 default y if SMP
0011 # Dynticks-idle tracking
0012 select CONTEXT_TRACKING_IDLE
0013 help
0014 This option selects the RCU implementation that is
0015 designed for very large SMP system with hundreds or
0016 thousands of CPUs. It also scales down nicely to
0017 smaller systems.
0018
0019 config PREEMPT_RCU
0020 bool
0021 default y if PREEMPTION
0022 select TREE_RCU
0023 help
0024 This option selects the RCU implementation that is
0025 designed for very large SMP systems with hundreds or
0026 thousands of CPUs, but for which real-time response
0027 is also required. It also scales down nicely to
0028 smaller systems.
0029
0030 Select this option if you are unsure.
0031
0032 config TINY_RCU
0033 bool
0034 default y if !PREEMPTION && !SMP
0035 help
0036 This option selects the RCU implementation that is
0037 designed for UP systems from which real-time response
0038 is not required. This option greatly reduces the
0039 memory footprint of RCU.
0040
0041 config RCU_EXPERT
0042 bool "Make expert-level adjustments to RCU configuration"
0043 default n
0044 help
0045 This option needs to be enabled if you wish to make
0046 expert-level adjustments to RCU configuration. By default,
0047 no such adjustments can be made, which has the often-beneficial
0048 side-effect of preventing "make oldconfig" from asking you all
0049 sorts of detailed questions about how you would like numerous
0050 obscure RCU options to be set up.
0051
0052 Say Y if you need to make expert-level adjustments to RCU.
0053
0054 Say N if you are unsure.
0055
0056 config SRCU
0057 bool
0058 help
0059 This option selects the sleepable version of RCU. This version
0060 permits arbitrary sleeping or blocking within RCU read-side critical
0061 sections.
0062
0063 config TINY_SRCU
0064 bool
0065 default y if SRCU && TINY_RCU
0066 help
0067 This option selects the single-CPU non-preemptible version of SRCU.
0068
0069 config TREE_SRCU
0070 bool
0071 default y if SRCU && !TINY_RCU
0072 help
0073 This option selects the full-fledged version of SRCU.
0074
0075 config TASKS_RCU_GENERIC
0076 def_bool TASKS_RCU || TASKS_RUDE_RCU || TASKS_TRACE_RCU
0077 select SRCU
0078 help
0079 This option enables generic infrastructure code supporting
0080 task-based RCU implementations. Not for manual selection.
0081
0082 config FORCE_TASKS_RCU
0083 bool "Force selection of TASKS_RCU"
0084 depends on RCU_EXPERT
0085 select TASKS_RCU
0086 default n
0087 help
0088 This option force-enables a task-based RCU implementation
0089 that uses only voluntary context switch (not preemption!),
0090 idle, and user-mode execution as quiescent states. Not for
0091 manual selection in most cases.
0092
0093 config TASKS_RCU
0094 bool
0095 default n
0096 select IRQ_WORK
0097
0098 config FORCE_TASKS_RUDE_RCU
0099 bool "Force selection of Tasks Rude RCU"
0100 depends on RCU_EXPERT
0101 select TASKS_RUDE_RCU
0102 default n
0103 help
0104 This option force-enables a task-based RCU implementation
0105 that uses only context switch (including preemption) and
0106 user-mode execution as quiescent states. It forces IPIs and
0107 context switches on all online CPUs, including idle ones,
0108 so use with caution. Not for manual selection in most cases.
0109
0110 config TASKS_RUDE_RCU
0111 bool
0112 default n
0113 select IRQ_WORK
0114
0115 config FORCE_TASKS_TRACE_RCU
0116 bool "Force selection of Tasks Trace RCU"
0117 depends on RCU_EXPERT
0118 select TASKS_TRACE_RCU
0119 default n
0120 help
0121 This option enables a task-based RCU implementation that uses
0122 explicit rcu_read_lock_trace() read-side markers, and allows
0123 these readers to appear in the idle loop as well as on the
0124 CPU hotplug code paths. It can force IPIs on online CPUs,
0125 including idle ones, so use with caution. Not for manual
0126 selection in most cases.
0127
0128 config TASKS_TRACE_RCU
0129 bool
0130 default n
0131 select IRQ_WORK
0132
0133 config RCU_STALL_COMMON
0134 def_bool TREE_RCU
0135 help
0136 This option enables RCU CPU stall code that is common between
0137 the TINY and TREE variants of RCU. The purpose is to allow
0138 the tiny variants to disable RCU CPU stall warnings, while
0139 making these warnings mandatory for the tree variants.
0140
0141 config RCU_NEED_SEGCBLIST
0142 def_bool ( TREE_RCU || TREE_SRCU || TASKS_RCU_GENERIC )
0143
0144 config RCU_FANOUT
0145 int "Tree-based hierarchical RCU fanout value"
0146 range 2 64 if 64BIT
0147 range 2 32 if !64BIT
0148 depends on TREE_RCU && RCU_EXPERT
0149 default 64 if 64BIT
0150 default 32 if !64BIT
0151 help
0152 This option controls the fanout of hierarchical implementations
0153 of RCU, allowing RCU to work efficiently on machines with
0154 large numbers of CPUs. This value must be at least the fourth
0155 root of NR_CPUS, which allows NR_CPUS to be insanely large.
0156 The default value of RCU_FANOUT should be used for production
0157 systems, but if you are stress-testing the RCU implementation
0158 itself, small RCU_FANOUT values allow you to test large-system
0159 code paths on small(er) systems.
0160
0161 Select a specific number if testing RCU itself.
0162 Take the default if unsure.
0163
0164 config RCU_FANOUT_LEAF
0165 int "Tree-based hierarchical RCU leaf-level fanout value"
0166 range 2 64 if 64BIT && !RCU_STRICT_GRACE_PERIOD
0167 range 2 32 if !64BIT && !RCU_STRICT_GRACE_PERIOD
0168 range 2 3 if RCU_STRICT_GRACE_PERIOD
0169 depends on TREE_RCU && RCU_EXPERT
0170 default 16 if !RCU_STRICT_GRACE_PERIOD
0171 default 2 if RCU_STRICT_GRACE_PERIOD
0172 help
0173 This option controls the leaf-level fanout of hierarchical
0174 implementations of RCU, and allows trading off cache misses
0175 against lock contention. Systems that synchronize their
0176 scheduling-clock interrupts for energy-efficiency reasons will
0177 want the default because the smaller leaf-level fanout keeps
0178 lock contention levels acceptably low. Very large systems
0179 (hundreds or thousands of CPUs) will instead want to set this
0180 value to the maximum value possible in order to reduce the
0181 number of cache misses incurred during RCU's grace-period
0182 initialization. These systems tend to run CPU-bound, and thus
0183 are not helped by synchronized interrupts, and thus tend to
0184 skew them, which reduces lock contention enough that large
0185 leaf-level fanouts work well. That said, setting leaf-level
0186 fanout to a large number will likely cause problematic
0187 lock contention on the leaf-level rcu_node structures unless
0188 you boot with the skew_tick kernel parameter.
0189
0190 Select a specific number if testing RCU itself.
0191
0192 Select the maximum permissible value for large systems, but
0193 please understand that you may also need to set the skew_tick
0194 kernel boot parameter to avoid contention on the rcu_node
0195 structure's locks.
0196
0197 Take the default if unsure.
0198
0199 config RCU_BOOST
0200 bool "Enable RCU priority boosting"
0201 depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT
0202 default y if PREEMPT_RT
0203 help
0204 This option boosts the priority of preempted RCU readers that
0205 block the current preemptible RCU grace period for too long.
0206 This option also prevents heavy loads from blocking RCU
0207 callback invocation.
0208
0209 Say Y here if you are working with real-time apps or heavy loads
0210 Say N here if you are unsure.
0211
0212 config RCU_BOOST_DELAY
0213 int "Milliseconds to delay boosting after RCU grace-period start"
0214 range 0 3000
0215 depends on RCU_BOOST
0216 default 500
0217 help
0218 This option specifies the time to wait after the beginning of
0219 a given grace period before priority-boosting preempted RCU
0220 readers blocking that grace period. Note that any RCU reader
0221 blocking an expedited RCU grace period is boosted immediately.
0222
0223 Accept the default if unsure.
0224
0225 config RCU_EXP_KTHREAD
0226 bool "Perform RCU expedited work in a real-time kthread"
0227 depends on RCU_BOOST && RCU_EXPERT
0228 default !PREEMPT_RT && NR_CPUS <= 32
0229 help
0230 Use this option to further reduce the latencies of expedited
0231 grace periods at the expense of being more disruptive.
0232
0233 This option is disabled by default on PREEMPT_RT=y kernels which
0234 disable expedited grace periods after boot by unconditionally
0235 setting rcupdate.rcu_normal_after_boot=1.
0236
0237 Accept the default if unsure.
0238
0239 config RCU_NOCB_CPU
0240 bool "Offload RCU callback processing from boot-selected CPUs"
0241 depends on TREE_RCU
0242 depends on RCU_EXPERT || NO_HZ_FULL
0243 default n
0244 help
0245 Use this option to reduce OS jitter for aggressive HPC or
0246 real-time workloads. It can also be used to offload RCU
0247 callback invocation to energy-efficient CPUs in battery-powered
0248 asymmetric multiprocessors. The price of this reduced jitter
0249 is that the overhead of call_rcu() increases and that some
0250 workloads will incur significant increases in context-switch
0251 rates.
0252
0253 This option offloads callback invocation from the set of CPUs
0254 specified at boot time by the rcu_nocbs parameter. For each
0255 such CPU, a kthread ("rcuox/N") will be created to invoke
0256 callbacks, where the "N" is the CPU being offloaded, and where
0257 the "x" is "p" for RCU-preempt (PREEMPTION kernels) and "s" for
0258 RCU-sched (!PREEMPTION kernels). Nothing prevents this kthread
0259 from running on the specified CPUs, but (1) the kthreads may be
0260 preempted between each callback, and (2) affinity or cgroups can
0261 be used to force the kthreads to run on whatever set of CPUs is
0262 desired.
0263
0264 Say Y here if you need reduced OS jitter, despite added overhead.
0265 Say N here if you are unsure.
0266
0267 config RCU_NOCB_CPU_DEFAULT_ALL
0268 bool "Offload RCU callback processing from all CPUs by default"
0269 depends on RCU_NOCB_CPU
0270 default n
0271 help
0272 Use this option to offload callback processing from all CPUs
0273 by default, in the absence of the rcu_nocbs or nohz_full boot
0274 parameter. This also avoids the need to use any boot parameters
0275 to achieve the effect of offloading all CPUs on boot.
0276
0277 Say Y here if you want offload all CPUs by default on boot.
0278 Say N here if you are unsure.
0279
0280 config RCU_NOCB_CPU_CB_BOOST
0281 bool "Offload RCU callback from real-time kthread"
0282 depends on RCU_NOCB_CPU && RCU_BOOST
0283 default y if PREEMPT_RT
0284 help
0285 Use this option to invoke offloaded callbacks as SCHED_FIFO
0286 to avoid starvation by heavy SCHED_OTHER background load.
0287 Of course, running as SCHED_FIFO during callback floods will
0288 cause the rcuo[ps] kthreads to monopolize the CPU for hundreds
0289 of milliseconds or more. Therefore, when enabling this option,
0290 it is your responsibility to ensure that latency-sensitive
0291 tasks either run with higher priority or run on some other CPU.
0292
0293 Say Y here if you want to set RT priority for offloading kthreads.
0294 Say N here if you are building a !PREEMPT_RT kernel and are unsure.
0295
0296 config TASKS_TRACE_RCU_READ_MB
0297 bool "Tasks Trace RCU readers use memory barriers in user and idle"
0298 depends on RCU_EXPERT && TASKS_TRACE_RCU
0299 default PREEMPT_RT || NR_CPUS < 8
0300 help
0301 Use this option to further reduce the number of IPIs sent
0302 to CPUs executing in userspace or idle during tasks trace
0303 RCU grace periods. Given that a reasonable setting of
0304 the rcupdate.rcu_task_ipi_delay kernel boot parameter
0305 eliminates such IPIs for many workloads, proper setting
0306 of this Kconfig option is important mostly for aggressive
0307 real-time installations and for battery-powered devices,
0308 hence the default chosen above.
0309
0310 Say Y here if you hate IPIs.
0311 Say N here if you hate read-side memory barriers.
0312 Take the default if you are unsure.
0313
0314 endmenu # "RCU Subsystem"