Kconfig 9.0 KB

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