hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/kernel/rcu/Kconfig
....@@ -1,3 +1,4 @@
1
+# SPDX-License-Identifier: GPL-2.0-only
12 #
23 # RCU-related configuration options
34 #
....@@ -6,7 +7,7 @@
67
78 config TREE_RCU
89 bool
9
- default y if !PREEMPT && SMP
10
+ default y if SMP
1011 help
1112 This option selects the RCU implementation that is
1213 designed for very large SMP system with hundreds or
....@@ -15,7 +16,8 @@
1516
1617 config PREEMPT_RCU
1718 bool
18
- default y if PREEMPT
19
+ default y if PREEMPTION
20
+ select TREE_RCU
1921 help
2022 This option selects the RCU implementation that is
2123 designed for very large SMP systems with hundreds or
....@@ -27,7 +29,7 @@
2729
2830 config TINY_RCU
2931 bool
30
- default y if !PREEMPT && !SMP
32
+ default y if !PREEMPTION && !SMP
3133 help
3234 This option selects the RCU implementation that is
3335 designed for UP systems from which real-time response
....@@ -68,16 +70,41 @@
6870 help
6971 This option selects the full-fledged version of SRCU.
7072
71
-config TASKS_RCU
72
- def_bool PREEMPT
73
+config TASKS_RCU_GENERIC
74
+ def_bool TASKS_RCU || TASKS_RUDE_RCU || TASKS_TRACE_RCU
7375 select SRCU
76
+ help
77
+ This option enables generic infrastructure code supporting
78
+ task-based RCU implementations. Not for manual selection.
79
+
80
+config TASKS_RCU
81
+ def_bool PREEMPTION
7482 help
7583 This option enables a task-based RCU implementation that uses
7684 only voluntary context switch (not preemption!), idle, and
77
- user-mode execution as quiescent states.
85
+ user-mode execution as quiescent states. Not for manual selection.
86
+
87
+config TASKS_RUDE_RCU
88
+ def_bool 0
89
+ select IRQ_WORK
90
+ help
91
+ This option enables a task-based RCU implementation that uses
92
+ only context switch (including preemption) and user-mode
93
+ execution as quiescent states. It forces IPIs and context
94
+ switches on all online CPUs, including idle ones, so use
95
+ with caution.
96
+
97
+config TASKS_TRACE_RCU
98
+ def_bool 0
99
+ help
100
+ This option enables a task-based RCU implementation that uses
101
+ explicit rcu_read_lock_trace() read-side markers, and allows
102
+ these readers to appear in the idle loop as well as on the CPU
103
+ hotplug code paths. It can force IPIs on online CPUs, including
104
+ idle ones, so use with caution.
78105
79106 config RCU_STALL_COMMON
80
- def_bool ( TREE_RCU || PREEMPT_RCU )
107
+ def_bool TREE_RCU
81108 help
82109 This option enables RCU CPU stall code that is common between
83110 the TINY and TREE variants of RCU. The purpose is to allow
....@@ -85,43 +112,13 @@
85112 making these warnings mandatory for the tree variants.
86113
87114 config RCU_NEED_SEGCBLIST
88
- def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU )
89
-
90
-config CONTEXT_TRACKING
91
- bool
92
-
93
-config CONTEXT_TRACKING_FORCE
94
- bool "Force context tracking"
95
- depends on CONTEXT_TRACKING
96
- default y if !NO_HZ_FULL
97
- help
98
- The major pre-requirement for full dynticks to work is to
99
- support the context tracking subsystem. But there are also
100
- other dependencies to provide in order to make the full
101
- dynticks working.
102
-
103
- This option stands for testing when an arch implements the
104
- context tracking backend but doesn't yet fullfill all the
105
- requirements to make the full dynticks feature working.
106
- Without the full dynticks, there is no way to test the support
107
- for context tracking and the subsystems that rely on it: RCU
108
- userspace extended quiescent state and tickless cputime
109
- accounting. This option copes with the absence of the full
110
- dynticks subsystem by forcing the context tracking on all
111
- CPUs in the system.
112
-
113
- Say Y only if you're working on the development of an
114
- architecture backend for the context tracking.
115
-
116
- Say N otherwise, this option brings an overhead that you
117
- don't want in production.
118
-
115
+ def_bool ( TREE_RCU || TREE_SRCU )
119116
120117 config RCU_FANOUT
121118 int "Tree-based hierarchical RCU fanout value"
122119 range 2 64 if 64BIT
123120 range 2 32 if !64BIT
124
- depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
121
+ depends on TREE_RCU && RCU_EXPERT
125122 default 64 if 64BIT
126123 default 32 if !64BIT
127124 help
....@@ -139,10 +136,12 @@
139136
140137 config RCU_FANOUT_LEAF
141138 int "Tree-based hierarchical RCU leaf-level fanout value"
142
- range 2 64 if 64BIT
143
- range 2 32 if !64BIT
144
- depends on (TREE_RCU || PREEMPT_RCU) && RCU_EXPERT
145
- default 16
139
+ range 2 64 if 64BIT && !RCU_STRICT_GRACE_PERIOD
140
+ range 2 32 if !64BIT && !RCU_STRICT_GRACE_PERIOD
141
+ range 2 3 if RCU_STRICT_GRACE_PERIOD
142
+ depends on TREE_RCU && RCU_EXPERT
143
+ default 16 if !RCU_STRICT_GRACE_PERIOD
144
+ default 2 if RCU_STRICT_GRACE_PERIOD
146145 help
147146 This option controls the leaf-level fanout of hierarchical
148147 implementations of RCU, and allows trading off cache misses
....@@ -172,7 +171,7 @@
172171
173172 config RCU_FAST_NO_HZ
174173 bool "Accelerate last non-dyntick-idle CPU's grace periods"
175
- depends on NO_HZ_COMMON && SMP && RCU_EXPERT && !PREEMPT_RT_FULL
174
+ depends on NO_HZ_COMMON && SMP && RCU_EXPERT
176175 default n
177176 help
178177 This option permits CPUs to enter dynticks-idle state even if
....@@ -190,13 +189,13 @@
190189
191190 config RCU_BOOST
192191 bool "Enable RCU priority boosting"
193
- depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT_FULL
194
- default y if PREEMPT_RT_FULL
192
+ depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT
193
+ default y if PREEMPT_RT
195194 help
196195 This option boosts the priority of preempted RCU readers that
197196 block the current preemptible RCU grace period for too long.
198197 This option also prevents heavy loads from blocking RCU
199
- callback invocation for all flavors of RCU.
198
+ callback invocation.
200199
201200 Say Y here if you are working with real-time apps or heavy loads
202201 Say N here if you are unsure.
....@@ -216,7 +215,7 @@
216215
217216 config RCU_NOCB_CPU
218217 bool "Offload RCU callback processing from boot-selected CPUs"
219
- depends on TREE_RCU || PREEMPT_RCU
218
+ depends on TREE_RCU
220219 depends on RCU_EXPERT || NO_HZ_FULL
221220 default n
222221 help
....@@ -225,12 +224,12 @@
225224 callback invocation to energy-efficient CPUs in battery-powered
226225 asymmetric multiprocessors.
227226
228
- This option offloads callback invocation from the set of
229
- CPUs specified at boot time by the rcu_nocbs parameter.
230
- For each such CPU, a kthread ("rcuox/N") will be created to
231
- invoke callbacks, where the "N" is the CPU being offloaded,
232
- and where the "x" is "b" for RCU-bh, "p" for RCU-preempt, and
233
- "s" for RCU-sched. Nothing prevents this kthread from running
227
+ This option offloads callback invocation from the set of CPUs
228
+ specified at boot time by the rcu_nocbs parameter. For each
229
+ such CPU, a kthread ("rcuox/N") will be created to invoke
230
+ callbacks, where the "N" is the CPU being offloaded, and where
231
+ the "p" for RCU-preempt (PREEMPTION kernels) and "s" for RCU-sched
232
+ (!PREEMPTION kernels). Nothing prevents this kthread from running
234233 on the specified CPUs, but (1) the kthreads may be preempted
235234 between each callback, and (2) affinity or cgroups can be used
236235 to force the kthreads to run on whatever set of CPUs is desired.
....@@ -238,4 +237,22 @@
238237 Say Y here if you want to help to debug reduced OS jitter.
239238 Say N here if you are unsure.
240239
240
+config TASKS_TRACE_RCU_READ_MB
241
+ bool "Tasks Trace RCU readers use memory barriers in user and idle"
242
+ depends on RCU_EXPERT
243
+ default PREEMPT_RT || NR_CPUS < 8
244
+ help
245
+ Use this option to further reduce the number of IPIs sent
246
+ to CPUs executing in userspace or idle during tasks trace
247
+ RCU grace periods. Given that a reasonable setting of
248
+ the rcupdate.rcu_task_ipi_delay kernel boot parameter
249
+ eliminates such IPIs for many workloads, proper setting
250
+ of this Kconfig option is important mostly for aggressive
251
+ real-time installations and for battery-powered devices,
252
+ hence the default chosen above.
253
+
254
+ Say Y here if you hate IPIs.
255
+ Say N here if you hate read-side memory barriers.
256
+ Take the default if you are unsure.
257
+
241258 endmenu # "RCU Subsystem"