Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. #
  3. # RCU-related configuration options
  4. #
  5. menu "RCU Subsystem"
  6. config TREE_RCU
  7. bool
  8. default y if SMP
  9. # Dynticks-idle tracking
  10. select CONTEXT_TRACKING_IDLE
  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. config PREEMPT_RCU
  17. bool
  18. default y if PREEMPTION
  19. select TREE_RCU
  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. Select this option if you are unsure.
  27. config TINY_RCU
  28. bool
  29. default y if !PREEMPTION && !SMP
  30. help
  31. This option selects the RCU implementation that is
  32. designed for UP systems from which real-time response
  33. is not required. This option greatly reduces the
  34. memory footprint of RCU.
  35. config RCU_EXPERT
  36. bool "Make expert-level adjustments to RCU configuration"
  37. default n
  38. help
  39. This option needs to be enabled if you wish to make
  40. expert-level adjustments to RCU configuration. By default,
  41. no such adjustments can be made, which has the often-beneficial
  42. side-effect of preventing "make oldconfig" from asking you all
  43. sorts of detailed questions about how you would like numerous
  44. obscure RCU options to be set up.
  45. Say Y if you need to make expert-level adjustments to RCU.
  46. Say N if you are unsure.
  47. config SRCU
  48. bool
  49. help
  50. This option selects the sleepable version of RCU. This version
  51. permits arbitrary sleeping or blocking within RCU read-side critical
  52. sections.
  53. config TINY_SRCU
  54. bool
  55. default y if SRCU && TINY_RCU
  56. help
  57. This option selects the single-CPU non-preemptible version of SRCU.
  58. config TREE_SRCU
  59. bool
  60. default y if SRCU && !TINY_RCU
  61. help
  62. This option selects the full-fledged version of SRCU.
  63. config TASKS_RCU_GENERIC
  64. def_bool TASKS_RCU || TASKS_RUDE_RCU || TASKS_TRACE_RCU
  65. select SRCU
  66. help
  67. This option enables generic infrastructure code supporting
  68. task-based RCU implementations. Not for manual selection.
  69. config FORCE_TASKS_RCU
  70. bool "Force selection of TASKS_RCU"
  71. depends on RCU_EXPERT
  72. select TASKS_RCU
  73. default n
  74. help
  75. This option force-enables a task-based RCU implementation
  76. that uses only voluntary context switch (not preemption!),
  77. idle, and user-mode execution as quiescent states. Not for
  78. manual selection in most cases.
  79. config TASKS_RCU
  80. bool
  81. default n
  82. select IRQ_WORK
  83. config FORCE_TASKS_RUDE_RCU
  84. bool "Force selection of Tasks Rude RCU"
  85. depends on RCU_EXPERT
  86. select TASKS_RUDE_RCU
  87. default n
  88. help
  89. This option force-enables a task-based RCU implementation
  90. that uses only context switch (including preemption) and
  91. user-mode execution as quiescent states. It forces IPIs and
  92. context switches on all online CPUs, including idle ones,
  93. so use with caution. Not for manual selection in most cases.
  94. config TASKS_RUDE_RCU
  95. bool
  96. default n
  97. select IRQ_WORK
  98. config FORCE_TASKS_TRACE_RCU
  99. bool "Force selection of Tasks Trace RCU"
  100. depends on RCU_EXPERT
  101. select TASKS_TRACE_RCU
  102. default n
  103. help
  104. This option enables a task-based RCU implementation that uses
  105. explicit rcu_read_lock_trace() read-side markers, and allows
  106. these readers to appear in the idle loop as well as on the
  107. CPU hotplug code paths. It can force IPIs on online CPUs,
  108. including idle ones, so use with caution. Not for manual
  109. selection in most cases.
  110. config TASKS_TRACE_RCU
  111. bool
  112. default n
  113. select IRQ_WORK
  114. config RCU_STALL_COMMON
  115. def_bool TREE_RCU
  116. help
  117. This option enables RCU CPU stall code that is common between
  118. the TINY and TREE variants of RCU. The purpose is to allow
  119. the tiny variants to disable RCU CPU stall warnings, while
  120. making these warnings mandatory for the tree variants.
  121. config RCU_NEED_SEGCBLIST
  122. def_bool ( TREE_RCU || TREE_SRCU || TASKS_RCU_GENERIC )
  123. config RCU_FANOUT
  124. int "Tree-based hierarchical RCU fanout value"
  125. range 2 64 if 64BIT
  126. range 2 32 if !64BIT
  127. depends on TREE_RCU && RCU_EXPERT
  128. default 64 if 64BIT
  129. default 32 if !64BIT
  130. help
  131. This option controls the fanout of hierarchical implementations
  132. of RCU, allowing RCU to work efficiently on machines with
  133. large numbers of CPUs. This value must be at least the fourth
  134. root of NR_CPUS, which allows NR_CPUS to be insanely large.
  135. The default value of RCU_FANOUT should be used for production
  136. systems, but if you are stress-testing the RCU implementation
  137. itself, small RCU_FANOUT values allow you to test large-system
  138. code paths on small(er) systems.
  139. Select a specific number if testing RCU itself.
  140. Take the default if unsure.
  141. config RCU_FANOUT_LEAF
  142. int "Tree-based hierarchical RCU leaf-level fanout value"
  143. range 2 64 if 64BIT && !RCU_STRICT_GRACE_PERIOD
  144. range 2 32 if !64BIT && !RCU_STRICT_GRACE_PERIOD
  145. range 2 3 if RCU_STRICT_GRACE_PERIOD
  146. depends on TREE_RCU && RCU_EXPERT
  147. default 16 if !RCU_STRICT_GRACE_PERIOD
  148. default 2 if RCU_STRICT_GRACE_PERIOD
  149. help
  150. This option controls the leaf-level fanout of hierarchical
  151. implementations of RCU, and allows trading off cache misses
  152. against lock contention. Systems that synchronize their
  153. scheduling-clock interrupts for energy-efficiency reasons will
  154. want the default because the smaller leaf-level fanout keeps
  155. lock contention levels acceptably low. Very large systems
  156. (hundreds or thousands of CPUs) will instead want to set this
  157. value to the maximum value possible in order to reduce the
  158. number of cache misses incurred during RCU's grace-period
  159. initialization. These systems tend to run CPU-bound, and thus
  160. are not helped by synchronized interrupts, and thus tend to
  161. skew them, which reduces lock contention enough that large
  162. leaf-level fanouts work well. That said, setting leaf-level
  163. fanout to a large number will likely cause problematic
  164. lock contention on the leaf-level rcu_node structures unless
  165. you boot with the skew_tick kernel parameter.
  166. Select a specific number if testing RCU itself.
  167. Select the maximum permissible value for large systems, but
  168. please understand that you may also need to set the skew_tick
  169. kernel boot parameter to avoid contention on the rcu_node
  170. structure's locks.
  171. Take the default if unsure.
  172. config RCU_BOOST
  173. bool "Enable RCU priority boosting"
  174. depends on (RT_MUTEXES && PREEMPT_RCU && RCU_EXPERT) || PREEMPT_RT
  175. default y if PREEMPT_RT
  176. help
  177. This option boosts the priority of preempted RCU readers that
  178. block the current preemptible RCU grace period for too long.
  179. This option also prevents heavy loads from blocking RCU
  180. callback invocation.
  181. Say Y here if you are working with real-time apps or heavy loads
  182. Say N here if you are unsure.
  183. config RCU_BOOST_DELAY
  184. int "Milliseconds to delay boosting after RCU grace-period start"
  185. range 0 3000
  186. depends on RCU_BOOST
  187. default 500
  188. help
  189. This option specifies the time to wait after the beginning of
  190. a given grace period before priority-boosting preempted RCU
  191. readers blocking that grace period. Note that any RCU reader
  192. blocking an expedited RCU grace period is boosted immediately.
  193. Accept the default if unsure.
  194. config RCU_EXP_KTHREAD
  195. bool "Perform RCU expedited work in a real-time kthread"
  196. depends on RCU_BOOST && RCU_EXPERT
  197. default !PREEMPT_RT && NR_CPUS <= 32
  198. help
  199. Use this option to further reduce the latencies of expedited
  200. grace periods at the expense of being more disruptive.
  201. This option is disabled by default on PREEMPT_RT=y kernels which
  202. disable expedited grace periods after boot by unconditionally
  203. setting rcupdate.rcu_normal_after_boot=1.
  204. Accept the default if unsure.
  205. config RCU_NOCB_CPU
  206. bool "Offload RCU callback processing from boot-selected CPUs"
  207. depends on TREE_RCU
  208. depends on RCU_EXPERT || NO_HZ_FULL
  209. default n
  210. help
  211. Use this option to reduce OS jitter for aggressive HPC or
  212. real-time workloads. It can also be used to offload RCU
  213. callback invocation to energy-efficient CPUs in battery-powered
  214. asymmetric multiprocessors. The price of this reduced jitter
  215. is that the overhead of call_rcu() increases and that some
  216. workloads will incur significant increases in context-switch
  217. rates.
  218. This option offloads callback invocation from the set of CPUs
  219. specified at boot time by the rcu_nocbs parameter. For each
  220. such CPU, a kthread ("rcuox/N") will be created to invoke
  221. callbacks, where the "N" is the CPU being offloaded, and where
  222. the "x" is "p" for RCU-preempt (PREEMPTION kernels) and "s" for
  223. RCU-sched (!PREEMPTION kernels). Nothing prevents this kthread
  224. from running on the specified CPUs, but (1) the kthreads may be
  225. preempted between each callback, and (2) affinity or cgroups can
  226. be used to force the kthreads to run on whatever set of CPUs is
  227. desired.
  228. Say Y here if you need reduced OS jitter, despite added overhead.
  229. Say N here if you are unsure.
  230. config RCU_NOCB_CPU_DEFAULT_ALL
  231. bool "Offload RCU callback processing from all CPUs by default"
  232. depends on RCU_NOCB_CPU
  233. default n
  234. help
  235. Use this option to offload callback processing from all CPUs
  236. by default, in the absence of the rcu_nocbs or nohz_full boot
  237. parameter. This also avoids the need to use any boot parameters
  238. to achieve the effect of offloading all CPUs on boot.
  239. Say Y here if you want offload all CPUs by default on boot.
  240. Say N here if you are unsure.
  241. config RCU_NOCB_CPU_CB_BOOST
  242. bool "Offload RCU callback from real-time kthread"
  243. depends on RCU_NOCB_CPU && RCU_BOOST
  244. default y if PREEMPT_RT
  245. help
  246. Use this option to invoke offloaded callbacks as SCHED_FIFO
  247. to avoid starvation by heavy SCHED_OTHER background load.
  248. Of course, running as SCHED_FIFO during callback floods will
  249. cause the rcuo[ps] kthreads to monopolize the CPU for hundreds
  250. of milliseconds or more. Therefore, when enabling this option,
  251. it is your responsibility to ensure that latency-sensitive
  252. tasks either run with higher priority or run on some other CPU.
  253. Say Y here if you want to set RT priority for offloading kthreads.
  254. Say N here if you are building a !PREEMPT_RT kernel and are unsure.
  255. config TASKS_TRACE_RCU_READ_MB
  256. bool "Tasks Trace RCU readers use memory barriers in user and idle"
  257. depends on RCU_EXPERT && TASKS_TRACE_RCU
  258. default PREEMPT_RT || NR_CPUS < 8
  259. help
  260. Use this option to further reduce the number of IPIs sent
  261. to CPUs executing in userspace or idle during tasks trace
  262. RCU grace periods. Given that a reasonable setting of
  263. the rcupdate.rcu_task_ipi_delay kernel boot parameter
  264. eliminates such IPIs for many workloads, proper setting
  265. of this Kconfig option is important mostly for aggressive
  266. real-time installations and for battery-powered devices,
  267. hence the default chosen above.
  268. Say Y here if you hate IPIs.
  269. Say N here if you hate read-side memory barriers.
  270. Take the default if you are unsure.
  271. config RCU_LAZY
  272. bool "RCU callback lazy invocation functionality"
  273. depends on RCU_NOCB_CPU
  274. default n
  275. help
  276. To save power, batch RCU callbacks and flush after delay, memory
  277. pressure, or callback list growing too big.
  278. Requires rcu_nocbs=all to be set.
  279. Use rcutree.enable_rcu_lazy=0 to turn it off at boot time.
  280. config RCU_LAZY_DEFAULT_OFF
  281. bool "Turn RCU lazy invocation off by default"
  282. depends on RCU_LAZY
  283. default n
  284. help
  285. Allows building the kernel with CONFIG_RCU_LAZY=y yet keep it default
  286. off. Boot time param rcutree.enable_rcu_lazy=1 can be used to switch
  287. it back on.
  288. config RCU_BOOT_END_DELAY
  289. int "Minimum time before RCU may consider in-kernel boot as completed"
  290. range 0 120000
  291. default 20000
  292. help
  293. Default value of the minimum time in milliseconds from the start of boot
  294. that must elapse before the boot sequence can be marked complete from RCU's
  295. perspective, after which RCU's behavior becomes more relaxed.
  296. Userspace can also mark the boot as completed sooner than this default
  297. by writing the time in milliseconds, say once userspace considers
  298. the system as booted, to: /sys/module/rcupdate/parameters/rcu_boot_end_delay.
  299. Or even just writing a value of 0 to this sysfs node. The sysfs node can
  300. also be used to extend the delay to be larger than the default, assuming
  301. the marking of boot completion has not yet occurred.
  302. The actual delay for RCU's view of the system to be marked as booted can be
  303. higher than this value if the kernel takes a long time to initialize but it
  304. will never be smaller than this value.
  305. Accept the default if unsure.
  306. endmenu # "RCU Subsystem"