1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 243a0a2a7SPaul E. McKenney# 343a0a2a7SPaul E. McKenney# RCU-related debugging configuration options 443a0a2a7SPaul E. McKenney# 543a0a2a7SPaul E. McKenney 643a0a2a7SPaul E. McKenneymenu "RCU Debugging" 743a0a2a7SPaul E. McKenney 843a0a2a7SPaul E. McKenneyconfig PROVE_RCU 943a0a2a7SPaul E. McKenney def_bool PROVE_LOCKING 1043a0a2a7SPaul E. McKenney 1128875945SJoel Fernandes (Google)config PROVE_RCU_LIST 1228875945SJoel Fernandes (Google) bool "RCU list lockdep debugging" 1328875945SJoel Fernandes (Google) depends on PROVE_RCU && RCU_EXPERT 1428875945SJoel Fernandes (Google) default n 1528875945SJoel Fernandes (Google) help 1628875945SJoel Fernandes (Google) Enable RCU lockdep checking for list usages. By default it is 1728875945SJoel Fernandes (Google) turned off since there are several list RCU users that still 1828875945SJoel Fernandes (Google) need to be converted to pass a lockdep expression. To prevent 1928875945SJoel Fernandes (Google) false-positive splats, we keep it default disabled but once all 2028875945SJoel Fernandes (Google) users are converted, we can remove this config option. 2128875945SJoel Fernandes (Google) 2243a0a2a7SPaul E. McKenneyconfig TORTURE_TEST 2343a0a2a7SPaul E. McKenney tristate 2443a0a2a7SPaul E. McKenney default n 2543a0a2a7SPaul E. McKenney 264e88ec4aSPaul E. McKenneyconfig RCU_SCALE_TEST 2743a0a2a7SPaul E. McKenney tristate "performance tests for RCU" 2843a0a2a7SPaul E. McKenney depends on DEBUG_KERNEL 2943a0a2a7SPaul E. McKenney select TORTURE_TEST 3043a0a2a7SPaul E. McKenney default n 3143a0a2a7SPaul E. McKenney help 3243a0a2a7SPaul E. McKenney This option provides a kernel module that runs performance 3343a0a2a7SPaul E. McKenney tests on the RCU infrastructure. The kernel module may be built 3443a0a2a7SPaul E. McKenney after the fact on the running kernel to be tested, if desired. 3543a0a2a7SPaul E. McKenney 3643a0a2a7SPaul E. McKenney Say Y here if you want RCU performance tests to be built into 3743a0a2a7SPaul E. McKenney the kernel. 3843a0a2a7SPaul E. McKenney Say M if you want the RCU performance tests to build as a module. 3943a0a2a7SPaul E. McKenney Say N if you are unsure. 4043a0a2a7SPaul E. McKenney 4143a0a2a7SPaul E. McKenneyconfig RCU_TORTURE_TEST 4243a0a2a7SPaul E. McKenney tristate "torture tests for RCU" 4343a0a2a7SPaul E. McKenney depends on DEBUG_KERNEL 4443a0a2a7SPaul E. McKenney select TORTURE_TEST 4543a0a2a7SPaul E. McKenney default n 4643a0a2a7SPaul E. McKenney help 4743a0a2a7SPaul E. McKenney This option provides a kernel module that runs torture tests 4843a0a2a7SPaul E. McKenney on the RCU infrastructure. The kernel module may be built 4943a0a2a7SPaul E. McKenney after the fact on the running kernel to be tested, if desired. 5043a0a2a7SPaul E. McKenney 5143a0a2a7SPaul E. McKenney Say Y here if you want RCU torture tests to be built into 5243a0a2a7SPaul E. McKenney the kernel. 5343a0a2a7SPaul E. McKenney Say M if you want the RCU torture tests to build as a module. 5443a0a2a7SPaul E. McKenney Say N if you are unsure. 5543a0a2a7SPaul E. McKenney 56ec9d6356SPaul E. McKenneyconfig RCU_TORTURE_TEST_CHK_RDR_STATE 57*5d45bdf2SPaul E. McKenney bool "Check rcutorture reader state" 58ec9d6356SPaul E. McKenney depends on RCU_TORTURE_TEST 59ec9d6356SPaul E. McKenney default n 60ec9d6356SPaul E. McKenney help 61ec9d6356SPaul E. McKenney This option causes rcutorture to check the desired rcutorture 62ec9d6356SPaul E. McKenney reader state for each segment against the actual context. 63ec9d6356SPaul E. McKenney Note that PREEMPT_COUNT must be enabled if the preempt-disabled 64ec9d6356SPaul E. McKenney and bh-disabled checks are to take effect, and that PREEMPT_RCU 65ec9d6356SPaul E. McKenney must be enabled for the RCU-nesting checks to take effect. 66ec9d6356SPaul E. McKenney These checks add overhead, and this Kconfig options is therefore 67ec9d6356SPaul E. McKenney disabled by default. 68ec9d6356SPaul E. McKenney 69ec9d6356SPaul E. McKenney Say Y here if you want rcutorture reader contexts checked. 70ec9d6356SPaul E. McKenney Say N if you are unsure. 71ec9d6356SPaul E. McKenney 72579a05daSPaul E. McKenneyconfig RCU_TORTURE_TEST_LOG_CPU 73*5d45bdf2SPaul E. McKenney bool "Log CPU for rcutorture failures" 74579a05daSPaul E. McKenney depends on RCU_TORTURE_TEST 75579a05daSPaul E. McKenney default n 76579a05daSPaul E. McKenney help 77579a05daSPaul E. McKenney This option causes rcutorture to decorate each entry of its 78579a05daSPaul E. McKenney log of failure/close-call rcutorture reader segments with the 79579a05daSPaul E. McKenney number of the CPU that the reader was running on at the time. 80579a05daSPaul E. McKenney This information can be useful, but it does incur additional 81579a05daSPaul E. McKenney overhead, overhead that can make both failures and close calls 82579a05daSPaul E. McKenney less probable. 83579a05daSPaul E. McKenney 84579a05daSPaul E. McKenney Say Y here if you want CPU IDs logged. 85579a05daSPaul E. McKenney Say N if you are unsure. 86579a05daSPaul E. McKenney 8784ae9101SPaul E. McKenneyconfig RCU_TORTURE_TEST_LOG_GP 8884ae9101SPaul E. McKenney bool "Log grace-period numbers for rcutorture failures" 8984ae9101SPaul E. McKenney depends on RCU_TORTURE_TEST 9084ae9101SPaul E. McKenney default n 9184ae9101SPaul E. McKenney help 9284ae9101SPaul E. McKenney This option causes rcutorture to decorate each entry of its 9384ae9101SPaul E. McKenney log of failure/close-call rcutorture reader segments with the 9484ae9101SPaul E. McKenney corresponding grace-period sequence numbers. This information 9584ae9101SPaul E. McKenney can be useful, but it does incur additional overhead, overhead 9684ae9101SPaul E. McKenney that can make both failures and close calls less probable. 9784ae9101SPaul E. McKenney 9884ae9101SPaul E. McKenney Say Y here if you want grace-period sequence numbers logged. 9984ae9101SPaul E. McKenney Say N if you are unsure. 10084ae9101SPaul E. McKenney 1018e4ec3d0SPaul E. McKenneyconfig RCU_REF_SCALE_TEST 1028e4ec3d0SPaul E. McKenney tristate "Scalability tests for read-side synchronization (RCU and others)" 103653ed64bSJoel Fernandes (Google) depends on DEBUG_KERNEL 104653ed64bSJoel Fernandes (Google) select TORTURE_TEST 105653ed64bSJoel Fernandes (Google) default n 106653ed64bSJoel Fernandes (Google) help 107653ed64bSJoel Fernandes (Google) This option provides a kernel module that runs performance tests 108653ed64bSJoel Fernandes (Google) useful comparing RCU with various read-side synchronization mechanisms. 109653ed64bSJoel Fernandes (Google) The kernel module may be built after the fact on the running kernel to be 110653ed64bSJoel Fernandes (Google) tested, if desired. 111653ed64bSJoel Fernandes (Google) 112653ed64bSJoel Fernandes (Google) Say Y here if you want these performance tests built into the kernel. 113653ed64bSJoel Fernandes (Google) Say M if you want to build it as a module instead. 114653ed64bSJoel Fernandes (Google) Say N if you are unsure. 115653ed64bSJoel Fernandes (Google) 11643a0a2a7SPaul E. McKenneyconfig RCU_CPU_STALL_TIMEOUT 11743a0a2a7SPaul E. McKenney int "RCU CPU stall timeout in seconds" 11843a0a2a7SPaul E. McKenney depends on RCU_STALL_COMMON 11943a0a2a7SPaul E. McKenney range 3 300 12043a0a2a7SPaul E. McKenney default 21 12143a0a2a7SPaul E. McKenney help 12243a0a2a7SPaul E. McKenney If a given RCU grace period extends more than the specified 12343a0a2a7SPaul E. McKenney number of seconds, a CPU stall warning is printed. If the 12443a0a2a7SPaul E. McKenney RCU grace period persists, additional CPU stall warnings are 12543a0a2a7SPaul E. McKenney printed at more widely spaced intervals. 12643a0a2a7SPaul E. McKenney 12728b3ae42SUladzislau Rezkiconfig RCU_EXP_CPU_STALL_TIMEOUT 12828b3ae42SUladzislau Rezki int "Expedited RCU CPU stall timeout in milliseconds" 12928b3ae42SUladzislau Rezki depends on RCU_STALL_COMMON 13084ec7c20SPaul E. McKenney range 0 300000 1311045a067SChristoph Hellwig default 0 13228b3ae42SUladzislau Rezki help 13328b3ae42SUladzislau Rezki If a given expedited RCU grace period extends more than the 13428b3ae42SUladzislau Rezki specified number of milliseconds, a CPU stall warning is printed. 13528b3ae42SUladzislau Rezki If the RCU grace period persists, additional CPU stall warnings 13628b3ae42SUladzislau Rezki are printed at more widely spaced intervals. A value of zero 13728b3ae42SUladzislau Rezki says to use the RCU_CPU_STALL_TIMEOUT value converted from 13828b3ae42SUladzislau Rezki seconds to milliseconds. 13928b3ae42SUladzislau Rezki 140be42f00bSZhen Leiconfig RCU_CPU_STALL_CPUTIME 141be42f00bSZhen Lei bool "Provide additional RCU stall debug information" 142be42f00bSZhen Lei depends on RCU_STALL_COMMON 143be42f00bSZhen Lei default n 144be42f00bSZhen Lei help 145be42f00bSZhen Lei Collect statistics during the sampling period, such as the number of 146be42f00bSZhen Lei (hard interrupts, soft interrupts, task switches) and the cputime of 147be42f00bSZhen Lei (hard interrupts, soft interrupts, kernel tasks) are added to the 148be42f00bSZhen Lei RCU stall report. For multiple continuous RCU stalls, all sampling 149be42f00bSZhen Lei periods begin at half of the first RCU stall timeout. 150be42f00bSZhen Lei The boot option rcupdate.rcu_cpu_stall_cputime has the same function 151be42f00bSZhen Lei as this one, but will override this if it exists. 152be42f00bSZhen Lei 1534e58aaeeSPaul E. McKenneyconfig RCU_CPU_STALL_NOTIFIER 1544e58aaeeSPaul E. McKenney bool "Provide RCU CPU-stall notifiers" 1554e58aaeeSPaul E. McKenney depends on RCU_STALL_COMMON 1564e58aaeeSPaul E. McKenney depends on DEBUG_KERNEL 1574e58aaeeSPaul E. McKenney depends on RCU_EXPERT 1584e58aaeeSPaul E. McKenney default n 1594e58aaeeSPaul E. McKenney help 1604e58aaeeSPaul E. McKenney WARNING: You almost certainly do not want this!!! 1614e58aaeeSPaul E. McKenney 1624e58aaeeSPaul E. McKenney Enable RCU CPU-stall notifiers, which are invoked just before 1634e58aaeeSPaul E. McKenney printing the RCU CPU stall warning. As such, bugs in notifier 1644e58aaeeSPaul E. McKenney callbacks can prevent stall warnings from being printed. 1654e58aaeeSPaul E. McKenney And the whole reason that a stall warning is being printed is 1664e58aaeeSPaul E. McKenney that something is hung up somewhere. Therefore, the notifier 1674e58aaeeSPaul E. McKenney callbacks must be written extremely carefully, preferably 1684e58aaeeSPaul E. McKenney containing only lockless code. After all, it is quite possible 1694e58aaeeSPaul E. McKenney that the whole reason that the RCU CPU stall is happening in 1704e58aaeeSPaul E. McKenney the first place is that someone forgot to release whatever lock 1714e58aaeeSPaul E. McKenney that you are thinking of acquiring. In which case, having your 1724e58aaeeSPaul E. McKenney notifier callback acquire that lock will hang, preventing the 1734e58aaeeSPaul E. McKenney RCU CPU stall warning from appearing. 1744e58aaeeSPaul E. McKenney 1754e58aaeeSPaul E. McKenney Say Y here if you want RCU CPU stall notifiers (you don't want them) 1764e58aaeeSPaul E. McKenney Say N if you are unsure. 1774e58aaeeSPaul E. McKenney 17843a0a2a7SPaul E. McKenneyconfig RCU_TRACE 17943a0a2a7SPaul E. McKenney bool "Enable tracing for RCU" 18043a0a2a7SPaul E. McKenney depends on DEBUG_KERNEL 18143a0a2a7SPaul E. McKenney default y if TREE_RCU 18243a0a2a7SPaul E. McKenney select TRACE_CLOCK 18343a0a2a7SPaul E. McKenney help 18443a0a2a7SPaul E. McKenney This option enables additional tracepoints for ftrace-style 18543a0a2a7SPaul E. McKenney event tracing. 18643a0a2a7SPaul E. McKenney 18743a0a2a7SPaul E. McKenney Say Y here if you want to enable RCU tracing 18843a0a2a7SPaul E. McKenney Say N if you are unsure. 18943a0a2a7SPaul E. McKenney 19043a0a2a7SPaul E. McKenneyconfig RCU_EQS_DEBUG 19143a0a2a7SPaul E. McKenney bool "Provide debugging asserts for adding NO_HZ support to an arch" 19243a0a2a7SPaul E. McKenney depends on DEBUG_KERNEL 19343a0a2a7SPaul E. McKenney help 19443a0a2a7SPaul E. McKenney This option provides consistency checks in RCU's handling of 19543a0a2a7SPaul E. McKenney NO_HZ. These checks have proven quite helpful in detecting 19643a0a2a7SPaul E. McKenney bugs in arch-specific NO_HZ code. 19743a0a2a7SPaul E. McKenney 19843a0a2a7SPaul E. McKenney Say N here if you need ultimate kernel/user switch latencies 19943a0a2a7SPaul E. McKenney Say Y if you are unsure 20043a0a2a7SPaul E. McKenney 2018cbd0e38SPaul E. McKenneyconfig RCU_STRICT_GRACE_PERIOD 2028cbd0e38SPaul E. McKenney bool "Provide debug RCU implementation with short grace periods" 203b3ade95bSPaul E. McKenney depends on DEBUG_KERNEL && RCU_EXPERT && NR_CPUS <= 4 && !TINY_RCU 2048cbd0e38SPaul E. McKenney default n 2058cbd0e38SPaul E. McKenney select PREEMPT_COUNT if PREEMPT=n 2068cbd0e38SPaul E. McKenney help 2078cbd0e38SPaul E. McKenney Select this option to build an RCU variant that is strict about 2088cbd0e38SPaul E. McKenney grace periods, making them as short as it can. This limits 2098cbd0e38SPaul E. McKenney scalability, destroys real-time response, degrades battery 2108cbd0e38SPaul E. McKenney lifetime and kills performance. Don't try this on large 2118cbd0e38SPaul E. McKenney machines, as in systems with more than about 10 or 20 CPUs. 2128cbd0e38SPaul E. McKenney But in conjunction with tools like KASAN, it can be helpful 2138cbd0e38SPaul E. McKenney when looking for certain types of RCU usage bugs, for example, 2148cbd0e38SPaul E. McKenney too-short RCU read-side critical sections. 2158cbd0e38SPaul E. McKenney 21643a0a2a7SPaul E. McKenneyendmenu # "RCU Debugging" 217