1# SPDX-License-Identifier: GPL-2.0-only 2# 3# RCU-related debugging configuration options 4# 5 6menu "RCU Debugging" 7 8config PROVE_RCU 9 def_bool PROVE_LOCKING 10 11config PROVE_RCU_LIST 12 bool "RCU list lockdep debugging" 13 depends on PROVE_RCU && RCU_EXPERT 14 default n 15 help 16 Enable RCU lockdep checking for list usages. By default it is 17 turned off since there are several list RCU users that still 18 need to be converted to pass a lockdep expression. To prevent 19 false-positive splats, we keep it default disabled but once all 20 users are converted, we can remove this config option. 21 22config TORTURE_TEST 23 tristate 24 default n 25 26config RCU_SCALE_TEST 27 tristate "performance tests for RCU" 28 depends on DEBUG_KERNEL 29 select TORTURE_TEST 30 default n 31 help 32 This option provides a kernel module that runs performance 33 tests on the RCU infrastructure. The kernel module may be built 34 after the fact on the running kernel to be tested, if desired. 35 36 Say Y here if you want RCU performance tests to be built into 37 the kernel. 38 Say M if you want the RCU performance tests to build as a module. 39 Say N if you are unsure. 40 41config RCU_TORTURE_TEST 42 tristate "torture tests for RCU" 43 depends on DEBUG_KERNEL 44 select TORTURE_TEST 45 default n 46 help 47 This option provides a kernel module that runs torture tests 48 on the RCU infrastructure. The kernel module may be built 49 after the fact on the running kernel to be tested, if desired. 50 51 Say Y here if you want RCU torture tests to be built into 52 the kernel. 53 Say M if you want the RCU torture tests to build as a module. 54 Say N if you are unsure. 55 56config RCU_TORTURE_TEST_CHK_RDR_STATE 57 tristate "Check rcutorture reader state" 58 depends on RCU_TORTURE_TEST 59 default n 60 help 61 This option causes rcutorture to check the desired rcutorture 62 reader state for each segment against the actual context. 63 Note that PREEMPT_COUNT must be enabled if the preempt-disabled 64 and bh-disabled checks are to take effect, and that PREEMPT_RCU 65 must be enabled for the RCU-nesting checks to take effect. 66 These checks add overhead, and this Kconfig options is therefore 67 disabled by default. 68 69 Say Y here if you want rcutorture reader contexts checked. 70 Say N if you are unsure. 71 72config RCU_TORTURE_TEST_LOG_CPU 73 tristate "Log CPU for rcutorture failures" 74 depends on RCU_TORTURE_TEST 75 default n 76 help 77 This option causes rcutorture to decorate each entry of its 78 log of failure/close-call rcutorture reader segments with the 79 number of the CPU that the reader was running on at the time. 80 This information can be useful, but it does incur additional 81 overhead, overhead that can make both failures and close calls 82 less probable. 83 84 Say Y here if you want CPU IDs logged. 85 Say N if you are unsure. 86 87config RCU_REF_SCALE_TEST 88 tristate "Scalability tests for read-side synchronization (RCU and others)" 89 depends on DEBUG_KERNEL 90 select TORTURE_TEST 91 default n 92 help 93 This option provides a kernel module that runs performance tests 94 useful comparing RCU with various read-side synchronization mechanisms. 95 The kernel module may be built after the fact on the running kernel to be 96 tested, if desired. 97 98 Say Y here if you want these performance tests built into the kernel. 99 Say M if you want to build it as a module instead. 100 Say N if you are unsure. 101 102config RCU_CPU_STALL_TIMEOUT 103 int "RCU CPU stall timeout in seconds" 104 depends on RCU_STALL_COMMON 105 range 3 300 106 default 21 107 help 108 If a given RCU grace period extends more than the specified 109 number of seconds, a CPU stall warning is printed. If the 110 RCU grace period persists, additional CPU stall warnings are 111 printed at more widely spaced intervals. 112 113config RCU_EXP_CPU_STALL_TIMEOUT 114 int "Expedited RCU CPU stall timeout in milliseconds" 115 depends on RCU_STALL_COMMON 116 range 0 300000 117 default 0 118 help 119 If a given expedited RCU grace period extends more than the 120 specified number of milliseconds, a CPU stall warning is printed. 121 If the RCU grace period persists, additional CPU stall warnings 122 are printed at more widely spaced intervals. A value of zero 123 says to use the RCU_CPU_STALL_TIMEOUT value converted from 124 seconds to milliseconds. 125 126config RCU_CPU_STALL_CPUTIME 127 bool "Provide additional RCU stall debug information" 128 depends on RCU_STALL_COMMON 129 default n 130 help 131 Collect statistics during the sampling period, such as the number of 132 (hard interrupts, soft interrupts, task switches) and the cputime of 133 (hard interrupts, soft interrupts, kernel tasks) are added to the 134 RCU stall report. For multiple continuous RCU stalls, all sampling 135 periods begin at half of the first RCU stall timeout. 136 The boot option rcupdate.rcu_cpu_stall_cputime has the same function 137 as this one, but will override this if it exists. 138 139config RCU_CPU_STALL_NOTIFIER 140 bool "Provide RCU CPU-stall notifiers" 141 depends on RCU_STALL_COMMON 142 depends on DEBUG_KERNEL 143 depends on RCU_EXPERT 144 default n 145 help 146 WARNING: You almost certainly do not want this!!! 147 148 Enable RCU CPU-stall notifiers, which are invoked just before 149 printing the RCU CPU stall warning. As such, bugs in notifier 150 callbacks can prevent stall warnings from being printed. 151 And the whole reason that a stall warning is being printed is 152 that something is hung up somewhere. Therefore, the notifier 153 callbacks must be written extremely carefully, preferably 154 containing only lockless code. After all, it is quite possible 155 that the whole reason that the RCU CPU stall is happening in 156 the first place is that someone forgot to release whatever lock 157 that you are thinking of acquiring. In which case, having your 158 notifier callback acquire that lock will hang, preventing the 159 RCU CPU stall warning from appearing. 160 161 Say Y here if you want RCU CPU stall notifiers (you don't want them) 162 Say N if you are unsure. 163 164config RCU_TRACE 165 bool "Enable tracing for RCU" 166 depends on DEBUG_KERNEL 167 default y if TREE_RCU 168 select TRACE_CLOCK 169 help 170 This option enables additional tracepoints for ftrace-style 171 event tracing. 172 173 Say Y here if you want to enable RCU tracing 174 Say N if you are unsure. 175 176config RCU_EQS_DEBUG 177 bool "Provide debugging asserts for adding NO_HZ support to an arch" 178 depends on DEBUG_KERNEL 179 help 180 This option provides consistency checks in RCU's handling of 181 NO_HZ. These checks have proven quite helpful in detecting 182 bugs in arch-specific NO_HZ code. 183 184 Say N here if you need ultimate kernel/user switch latencies 185 Say Y if you are unsure 186 187config RCU_STRICT_GRACE_PERIOD 188 bool "Provide debug RCU implementation with short grace periods" 189 depends on DEBUG_KERNEL && RCU_EXPERT && NR_CPUS <= 4 && !TINY_RCU 190 default n 191 select PREEMPT_COUNT if PREEMPT=n 192 help 193 Select this option to build an RCU variant that is strict about 194 grace periods, making them as short as it can. This limits 195 scalability, destroys real-time response, degrades battery 196 lifetime and kills performance. Don't try this on large 197 machines, as in systems with more than about 10 or 20 CPUs. 198 But in conjunction with tools like KASAN, it can be helpful 199 when looking for certain types of RCU usage bugs, for example, 200 too-short RCU read-side critical sections. 201 202endmenu # "RCU Debugging" 203