Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: RCU: Convert torture.txt to ReST

- Add a SPDX header;
- Adjust document and section titles;
- Some whitespace fixes and new line breaks;
- Mark literal blocks as such;
- Add it to RCU/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Paul E. McKenney
43cb5451 2cdb54c9

+68 -56
+1
Documentation/RCU/index.rst
··· 18 18 whatisRCU 19 19 rcu 20 20 rculist_nulls 21 + torture 21 22 listRCU 22 23 NMI-RCU 23 24 UP
+63 -52
Documentation/RCU/torture.txt Documentation/RCU/torture.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ========================== 1 4 RCU Torture Test Operation 5 + ========================== 2 6 3 7 4 8 CONFIG_RCU_TORTURE_TEST 9 + ======================= 5 10 6 11 The CONFIG_RCU_TORTURE_TEST config option is available for all RCU 7 12 implementations. It creates an rcutorture kernel module that can ··· 18 13 Module parameters are prefixed by "rcutorture." in 19 14 Documentation/admin-guide/kernel-parameters.txt. 20 15 21 - OUTPUT 16 + Output 17 + ====== 22 18 23 - The statistics output is as follows: 19 + The statistics output is as follows:: 24 20 25 21 rcu-torture:--- Start of test: nreaders=16 nfakewriters=4 stat_interval=30 verbose=0 test_no_idle_hz=1 shuffle_interval=3 stutter=5 irqreader=1 fqs_duration=0 fqs_holdoff=0 fqs_stutter=3 test_boost=1/0 test_boost_interval=7 test_boost_duration=4 26 22 rcu-torture: rtc: (null) ver: 155441 tfle: 0 rta: 155441 rtaf: 8884 rtf: 155440 rtmbe: 0 rtbe: 0 rtbke: 0 rtbre: 0 rtbf: 0 rtb: 0 nt: 3055767 ··· 42 36 43 37 The entries are as follows: 44 38 45 - o "rtc": The hexadecimal address of the structure currently visible 39 + * "rtc": The hexadecimal address of the structure currently visible 46 40 to readers. 47 41 48 - o "ver": The number of times since boot that the RCU writer task 42 + * "ver": The number of times since boot that the RCU writer task 49 43 has changed the structure visible to readers. 50 44 51 - o "tfle": If non-zero, indicates that the "torture freelist" 45 + * "tfle": If non-zero, indicates that the "torture freelist" 52 46 containing structures to be placed into the "rtc" area is empty. 53 47 This condition is important, since it can fool you into thinking 54 48 that RCU is working when it is not. :-/ 55 49 56 - o "rta": Number of structures allocated from the torture freelist. 50 + * "rta": Number of structures allocated from the torture freelist. 57 51 58 - o "rtaf": Number of allocations from the torture freelist that have 52 + * "rtaf": Number of allocations from the torture freelist that have 59 53 failed due to the list being empty. It is not unusual for this 60 54 to be non-zero, but it is bad for it to be a large fraction of 61 55 the value indicated by "rta". 62 56 63 - o "rtf": Number of frees into the torture freelist. 57 + * "rtf": Number of frees into the torture freelist. 64 58 65 - o "rtmbe": A non-zero value indicates that rcutorture believes that 59 + * "rtmbe": A non-zero value indicates that rcutorture believes that 66 60 rcu_assign_pointer() and rcu_dereference() are not working 67 61 correctly. This value should be zero. 68 62 69 - o "rtbe": A non-zero value indicates that one of the rcu_barrier() 63 + * "rtbe": A non-zero value indicates that one of the rcu_barrier() 70 64 family of functions is not working correctly. 71 65 72 - o "rtbke": rcutorture was unable to create the real-time kthreads 66 + * "rtbke": rcutorture was unable to create the real-time kthreads 73 67 used to force RCU priority inversion. This value should be zero. 74 68 75 - o "rtbre": Although rcutorture successfully created the kthreads 69 + * "rtbre": Although rcutorture successfully created the kthreads 76 70 used to force RCU priority inversion, it was unable to set them 77 71 to the real-time priority level of 1. This value should be zero. 78 72 79 - o "rtbf": The number of times that RCU priority boosting failed 73 + * "rtbf": The number of times that RCU priority boosting failed 80 74 to resolve RCU priority inversion. 81 75 82 - o "rtb": The number of times that rcutorture attempted to force 76 + * "rtb": The number of times that rcutorture attempted to force 83 77 an RCU priority inversion condition. If you are testing RCU 84 78 priority boosting via the "test_boost" module parameter, this 85 79 value should be non-zero. 86 80 87 - o "nt": The number of times rcutorture ran RCU read-side code from 81 + * "nt": The number of times rcutorture ran RCU read-side code from 88 82 within a timer handler. This value should be non-zero only 89 83 if you specified the "irqreader" module parameter. 90 84 91 - o "Reader Pipe": Histogram of "ages" of structures seen by readers. 85 + * "Reader Pipe": Histogram of "ages" of structures seen by readers. 92 86 If any entries past the first two are non-zero, RCU is broken. 93 87 And rcutorture prints the error flag string "!!!" to make sure 94 88 you notice. The age of a newly allocated structure is zero, ··· 100 94 RCU. If you want to see what it looks like when broken, break 101 95 it yourself. ;-) 102 96 103 - o "Reader Batch": Another histogram of "ages" of structures seen 97 + * "Reader Batch": Another histogram of "ages" of structures seen 104 98 by readers, but in terms of counter flips (or batches) rather 105 99 than in terms of grace periods. The legal number of non-zero 106 100 entries is again two. The reason for this separate view is that 107 101 it is sometimes easier to get the third entry to show up in the 108 102 "Reader Batch" list than in the "Reader Pipe" list. 109 103 110 - o "Free-Block Circulation": Shows the number of torture structures 104 + * "Free-Block Circulation": Shows the number of torture structures 111 105 that have reached a given point in the pipeline. The first element 112 106 should closely correspond to the number of structures allocated, 113 107 the second to the number that have been removed from reader view, ··· 118 112 119 113 Different implementations of RCU can provide implementation-specific 120 114 additional information. For example, Tree SRCU provides the following 121 - additional line: 115 + additional line:: 122 116 123 117 srcud-torture: Tree SRCU per-CPU(idx=0): 0(35,-21) 1(-4,24) 2(1,1) 3(-26,20) 4(28,-47) 5(-9,4) 6(-10,14) 7(-14,11) T(1,6) 124 118 ··· 129 123 "old" and "current" values to the underlying array, and is useful for 130 124 debugging. The final "T" entry contains the totals of the counters. 131 125 132 - 133 - USAGE ON SPECIFIC KERNEL BUILDS 126 + Usage on Specific Kernel Builds 127 + =============================== 134 128 135 129 It is sometimes desirable to torture RCU on a specific kernel build, 136 130 for example, when preparing to put that kernel build into production. 137 131 In that case, the kernel should be built with CONFIG_RCU_TORTURE_TEST=m 138 132 so that the test can be started using modprobe and terminated using rmmod. 139 133 140 - For example, the following script may be used to torture RCU: 134 + For example, the following script may be used to torture RCU:: 141 135 142 136 #!/bin/sh 143 137 ··· 154 148 were no RCU failures, CPU-hotplug problems were detected. 155 149 156 150 157 - USAGE ON MAINLINE KERNELS 151 + Usage on Mainline Kernels 152 + ========================= 158 153 159 154 When using rcutorture to test changes to RCU itself, it is often 160 155 necessary to build a number of kernels in order to test that change ··· 187 180 --configs argument to kvm.sh as follows: "--configs 'SRCU-N SRCU-P'". 188 181 Large systems can run multiple copies of of the full set of scenarios, 189 182 for example, a system with 448 hardware threads can run five instances 190 - of the full set concurrently. To make this happen: 183 + of the full set concurrently. To make this happen:: 191 184 192 185 kvm.sh --cpus 448 --configs '5*CFLIST' 193 186 194 187 Alternatively, such a system can run 56 concurrent instances of a single 195 - eight-CPU scenario: 188 + eight-CPU scenario:: 196 189 197 190 kvm.sh --cpus 448 --configs '56*TREE04' 198 191 199 - Or 28 concurrent instances of each of two eight-CPU scenarios: 192 + Or 28 concurrent instances of each of two eight-CPU scenarios:: 200 193 201 194 kvm.sh --cpus 448 --configs '28*TREE03 28*TREE04' 202 195 ··· 206 199 using the --bootargs parameter discussed below. 207 200 208 201 Sometimes additional debugging is useful, and in such cases the --kconfig 209 - parameter to kvm.sh may be used, for example, "--kconfig 'CONFIG_KASAN=y'". 202 + parameter to kvm.sh may be used, for example, ``--kconfig 'CONFIG_KASAN=y'``. 210 203 211 204 Kernel boot arguments can also be supplied, for example, to control 212 205 rcutorture's module parameters. For example, to test a change to RCU's 213 206 CPU stall-warning code, use "--bootargs 'rcutorture.stall_cpu=30'". 214 207 This will of course result in the scripting reporting a failure, namely 215 208 the resuling RCU CPU stall warning. As noted above, reducing memory may 216 - require disabling rcutorture's callback-flooding tests: 209 + require disabling rcutorture's callback-flooding tests:: 217 210 218 211 kvm.sh --cpus 448 --configs '56*TREE04' --memory 128M \ 219 212 --bootargs 'rcutorture.fwd_progress=0' ··· 232 225 to a file. The build products and console output of each run is kept in 233 226 tools/testing/selftests/rcutorture/res in timestamped directories. A 234 227 given directory can be supplied to kvm-find-errors.sh in order to have 235 - it cycle you through summaries of errors and full error logs. For example: 228 + it cycle you through summaries of errors and full error logs. For example:: 236 229 237 230 tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh \ 238 231 tools/testing/selftests/rcutorture/res/2020.01.20-15.54.23 ··· 252 245 253 246 The most frequently used files in each per-scenario-run directory are: 254 247 255 - .config: This file contains the Kconfig options. 248 + .config: 249 + This file contains the Kconfig options. 256 250 257 - Make.out: This contains build output for a specific scenario. 251 + Make.out: 252 + This contains build output for a specific scenario. 258 253 259 - console.log: This contains the console output for a specific scenario. 254 + console.log: 255 + This contains the console output for a specific scenario. 260 256 This file may be examined once the kernel has booted, but 261 257 it might not exist if the build failed. 262 258 263 - vmlinux: This contains the kernel, which can be useful with tools like 259 + vmlinux: 260 + This contains the kernel, which can be useful with tools like 264 261 objdump and gdb. 265 262 266 263 A number of additional files are available, but are less frequently used. 267 264 Many are intended for debugging of rcutorture itself or of its scripting. 268 265 269 266 As of v5.4, a successful run with the default set of scenarios produces 270 - the following summary at the end of the run on a 12-CPU system: 267 + the following summary at the end of the run on a 12-CPU system:: 271 268 272 - SRCU-N ------- 804233 GPs (148.932/s) [srcu: g10008272 f0x0 ] 273 - SRCU-P ------- 202320 GPs (37.4667/s) [srcud: g1809476 f0x0 ] 274 - SRCU-t ------- 1122086 GPs (207.794/s) [srcu: g0 f0x0 ] 275 - SRCU-u ------- 1111285 GPs (205.794/s) [srcud: g1 f0x0 ] 276 - TASKS01 ------- 19666 GPs (3.64185/s) [tasks: g0 f0x0 ] 277 - TASKS02 ------- 20541 GPs (3.80389/s) [tasks: g0 f0x0 ] 278 - TASKS03 ------- 19416 GPs (3.59556/s) [tasks: g0 f0x0 ] 279 - TINY01 ------- 836134 GPs (154.84/s) [rcu: g0 f0x0 ] n_max_cbs: 34198 280 - TINY02 ------- 850371 GPs (157.476/s) [rcu: g0 f0x0 ] n_max_cbs: 2631 281 - TREE01 ------- 162625 GPs (30.1157/s) [rcu: g1124169 f0x0 ] 282 - TREE02 ------- 333003 GPs (61.6672/s) [rcu: g2647753 f0x0 ] n_max_cbs: 35844 283 - TREE03 ------- 306623 GPs (56.782/s) [rcu: g2975325 f0x0 ] n_max_cbs: 1496497 284 - CPU count limited from 16 to 12 285 - TREE04 ------- 246149 GPs (45.5831/s) [rcu: g1695737 f0x0 ] n_max_cbs: 434961 286 - TREE05 ------- 314603 GPs (58.2598/s) [rcu: g2257741 f0x2 ] n_max_cbs: 193997 287 - TREE07 ------- 167347 GPs (30.9902/s) [rcu: g1079021 f0x0 ] n_max_cbs: 478732 288 - CPU count limited from 16 to 12 289 - TREE09 ------- 752238 GPs (139.303/s) [rcu: g13075057 f0x0 ] n_max_cbs: 99011 269 + SRCU-N ------- 804233 GPs (148.932/s) [srcu: g10008272 f0x0 ] 270 + SRCU-P ------- 202320 GPs (37.4667/s) [srcud: g1809476 f0x0 ] 271 + SRCU-t ------- 1122086 GPs (207.794/s) [srcu: g0 f0x0 ] 272 + SRCU-u ------- 1111285 GPs (205.794/s) [srcud: g1 f0x0 ] 273 + TASKS01 ------- 19666 GPs (3.64185/s) [tasks: g0 f0x0 ] 274 + TASKS02 ------- 20541 GPs (3.80389/s) [tasks: g0 f0x0 ] 275 + TASKS03 ------- 19416 GPs (3.59556/s) [tasks: g0 f0x0 ] 276 + TINY01 ------- 836134 GPs (154.84/s) [rcu: g0 f0x0 ] n_max_cbs: 34198 277 + TINY02 ------- 850371 GPs (157.476/s) [rcu: g0 f0x0 ] n_max_cbs: 2631 278 + TREE01 ------- 162625 GPs (30.1157/s) [rcu: g1124169 f0x0 ] 279 + TREE02 ------- 333003 GPs (61.6672/s) [rcu: g2647753 f0x0 ] n_max_cbs: 35844 280 + TREE03 ------- 306623 GPs (56.782/s) [rcu: g2975325 f0x0 ] n_max_cbs: 1496497 281 + CPU count limited from 16 to 12 282 + TREE04 ------- 246149 GPs (45.5831/s) [rcu: g1695737 f0x0 ] n_max_cbs: 434961 283 + TREE05 ------- 314603 GPs (58.2598/s) [rcu: g2257741 f0x2 ] n_max_cbs: 193997 284 + TREE07 ------- 167347 GPs (30.9902/s) [rcu: g1079021 f0x0 ] n_max_cbs: 478732 285 + CPU count limited from 16 to 12 286 + TREE09 ------- 752238 GPs (139.303/s) [rcu: g13075057 f0x0 ] n_max_cbs: 99011
+1 -1
Documentation/locking/locktorture.rst
··· 166 166 two are self-explanatory, while the last indicates that while there 167 167 were no locking failures, CPU-hotplug problems were detected. 168 168 169 - Also see: Documentation/RCU/torture.txt 169 + Also see: Documentation/RCU/torture.rst
+2 -2
MAINTAINERS
··· 14437 14437 F: Documentation/RCU/ 14438 14438 F: include/linux/rcu* 14439 14439 F: kernel/rcu/ 14440 - X: Documentation/RCU/torture.txt 14440 + X: Documentation/RCU/torture.rst 14441 14441 X: include/linux/srcu*.h 14442 14442 X: kernel/rcu/srcu*.c 14443 14443 ··· 17288 17288 L: linux-kernel@vger.kernel.org 17289 17289 S: Supported 17290 17290 T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev 17291 - F: Documentation/RCU/torture.txt 17291 + F: Documentation/RCU/torture.rst 17292 17292 F: kernel/locking/locktorture.c 17293 17293 F: kernel/rcu/rcuperf.c 17294 17294 F: kernel/rcu/rcutorture.c
+1 -1
kernel/rcu/rcutorture.c
··· 7 7 * Authors: Paul E. McKenney <paulmck@linux.ibm.com> 8 8 * Josh Triplett <josh@joshtriplett.org> 9 9 * 10 - * See also: Documentation/RCU/torture.txt 10 + * See also: Documentation/RCU/torture.rst 11 11 */ 12 12 13 13 #define pr_fmt(fmt) fmt