Kconfig 12 KB

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