• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# RCU-related configuration options
4#
5
6menu "RCU Subsystem"
7
8config TREE_RCU
9	bool
10	default y if !PREEMPTION && SMP
11	help
12	  This option selects the RCU implementation that is
13	  designed for very large SMP system with hundreds or
14	  thousands of CPUs.  It also scales down nicely to
15	  smaller systems.
16
17config PREEMPT_RCU
18	bool
19	default y if PREEMPTION
20	help
21	  This option selects the RCU implementation that is
22	  designed for very large SMP systems with hundreds or
23	  thousands of CPUs, but for which real-time response
24	  is also required.  It also scales down nicely to
25	  smaller systems.
26
27	  Select this option if you are unsure.
28
29config TINY_RCU
30	bool
31	default y if !PREEMPTION && !SMP
32	help
33	  This option selects the RCU implementation that is
34	  designed for UP systems from which real-time response
35	  is not required.  This option greatly reduces the
36	  memory footprint of RCU.
37
38config RCU_EXPERT
39	bool "Make expert-level adjustments to RCU configuration"
40	default n
41	help
42	  This option needs to be enabled if you wish to make
43	  expert-level adjustments to RCU configuration.  By default,
44	  no such adjustments can be made, which has the often-beneficial
45	  side-effect of preventing "make oldconfig" from asking you all
46	  sorts of detailed questions about how you would like numerous
47	  obscure RCU options to be set up.
48
49	  Say Y if you need to make expert-level adjustments to RCU.
50
51	  Say N if you are unsure.
52
53config SRCU
54	bool
55	help
56	  This option selects the sleepable version of RCU. This version
57	  permits arbitrary sleeping or blocking within RCU read-side critical
58	  sections.
59
60config TINY_SRCU
61	bool
62	default y if SRCU && TINY_RCU
63	help
64	  This option selects the single-CPU non-preemptible version of SRCU.
65
66config TREE_SRCU
67	bool
68	default y if SRCU && !TINY_RCU
69	help
70	  This option selects the full-fledged version of SRCU.
71
72config TASKS_RCU
73	def_bool PREEMPTION
74	select SRCU
75	help
76	  This option enables a task-based RCU implementation that uses
77	  only voluntary context switch (not preemption!), idle, and
78	  user-mode execution as quiescent states.
79
80config RCU_STALL_COMMON
81	def_bool ( TREE_RCU || PREEMPT_RCU )
82	help
83	  This option enables RCU CPU stall code that is common between
84	  the TINY and TREE variants of RCU.  The purpose is to allow
85	  the tiny variants to disable RCU CPU stall warnings, while
86	  making these warnings mandatory for the tree variants.
87
88config RCU_NEED_SEGCBLIST
89	def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU )
90
91config RCU_FANOUT
92	int "Tree-based hierarchical RCU fanout value"
93	range 2 64 if 64BIT
94	range 2 32 if !64BIT
95	depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
96	default 64 if 64BIT
97	default 32 if !64BIT
98	help
99	  This option controls the fanout of hierarchical implementations
100	  of RCU, allowing RCU to work efficiently on machines with
101	  large numbers of CPUs.  This value must be at least the fourth
102	  root of NR_CPUS, which allows NR_CPUS to be insanely large.
103	  The default value of RCU_FANOUT should be used for production
104	  systems, but if you are stress-testing the RCU implementation
105	  itself, small RCU_FANOUT values allow you to test large-system
106	  code paths on small(er) systems.
107
108	  Select a specific number if testing RCU itself.
109	  Take the default if unsure.
110
111config RCU_FANOUT_LEAF
112	int "Tree-based hierarchical RCU leaf-level fanout value"
113	range 2 64 if 64BIT
114	range 2 32 if !64BIT
115	depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
116	default 16
117	help
118	  This option controls the leaf-level fanout of hierarchical
119	  implementations of RCU, and allows trading off cache misses
120	  against lock contention.  Systems that synchronize their
121	  scheduling-clock interrupts for energy-efficiency reasons will
122	  want the default because the smaller leaf-level fanout keeps
123	  lock contention levels acceptably low.  Very large systems
124	  (hundreds or thousands of CPUs) will instead want to set this
125	  value to the maximum value possible in order to reduce the
126	  number of cache misses incurred during RCU's grace-period
127	  initialization.  These systems tend to run CPU-bound, and thus
128	  are not helped by synchronized interrupts, and thus tend to
129	  skew them, which reduces lock contention enough that large
130	  leaf-level fanouts work well.  That said, setting leaf-level
131	  fanout to a large number will likely cause problematic
132	  lock contention on the leaf-level rcu_node structures unless
133	  you boot with the skew_tick kernel parameter.
134
135	  Select a specific number if testing RCU itself.
136
137	  Select the maximum permissible value for large systems, but
138	  please understand that you may also need to set the skew_tick
139	  kernel boot parameter to avoid contention on the rcu_node
140	  structure's locks.
141
142	  Take the default if unsure.
143
144config RCU_FAST_NO_HZ
145	bool "Accelerate last non-dyntick-idle CPU's grace periods"
146	depends on NO_HZ_COMMON && SMP && RCU_EXPERT
147	default n
148	help
149	  This option permits CPUs to enter dynticks-idle state even if
150	  they have RCU callbacks queued, and prevents RCU from waking
151	  these CPUs up more than roughly once every four jiffies (by
152	  default, you can adjust this using the rcutree.rcu_idle_gp_delay
153	  parameter), thus improving energy efficiency.  On the other
154	  hand, this option increases the duration of RCU grace periods,
155	  for example, slowing down synchronize_rcu().
156
157	  Say Y if energy efficiency is critically important, and you
158	  	don't care about increased grace-period durations.
159
160	  Say N if you are unsure.
161
162config RCU_BOOST
163	bool "Enable RCU priority boosting"
164	depends on RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT
165	default n
166	help
167	  This option boosts the priority of preempted RCU readers that
168	  block the current preemptible RCU grace period for too long.
169	  This option also prevents heavy loads from blocking RCU
170	  callback invocation.
171
172	  Say Y here if you are working with real-time apps or heavy loads
173	  Say N here if you are unsure.
174
175config RCU_BOOST_DELAY
176	int "Milliseconds to delay boosting after RCU grace-period start"
177	range 0 3000
178	depends on RCU_BOOST
179	default 500
180	help
181	  This option specifies the time to wait after the beginning of
182	  a given grace period before priority-boosting preempted RCU
183	  readers blocking that grace period.  Note that any RCU reader
184	  blocking an expedited RCU grace period is boosted immediately.
185
186	  Accept the default if unsure.
187
188config RCU_NOCB_CPU
189	bool "Offload RCU callback processing from boot-selected CPUs"
190	depends on TREE_RCU || PREEMPT_RCU
191	depends on RCU_EXPERT || NO_HZ_FULL
192	default n
193	help
194	  Use this option to reduce OS jitter for aggressive HPC or
195	  real-time workloads.	It can also be used to offload RCU
196	  callback invocation to energy-efficient CPUs in battery-powered
197	  asymmetric multiprocessors.
198
199	  This option offloads callback invocation from the set of CPUs
200	  specified at boot time by the rcu_nocbs parameter.  For each
201	  such CPU, a kthread ("rcuox/N") will be created to invoke
202	  callbacks, where the "N" is the CPU being offloaded, and where
203	  the "p" for RCU-preempt (PREEMPT kernels) and "s" for RCU-sched
204	  (!PREEMPT kernels).  Nothing prevents this kthread from running
205	  on the specified CPUs, but (1) the kthreads may be preempted
206	  between each callback, and (2) affinity or cgroups can be used
207	  to force the kthreads to run on whatever set of CPUs is desired.
208
209	  Say Y here if you want to help to debug reduced OS jitter.
210	  Say N here if you are unsure.
211
212endmenu # "RCU Subsystem"
213