Skip to content

Commit 43cb545

Browse files
mchehabpaulmckrcu
authored andcommitted
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 <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 2cdb54c commit 43cb545

File tree

5 files changed

+69
-57
lines changed

5 files changed

+69
-57
lines changed

Documentation/RCU/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ RCU concepts
1818
whatisRCU
1919
rcu
2020
rculist_nulls
21+
torture
2122
listRCU
2223
NMI-RCU
2324
UP

Documentation/RCU/torture.txt renamed to Documentation/RCU/torture.rst

Lines changed: 64 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
==========================
14
RCU Torture Test Operation
5+
==========================
26

37

48
CONFIG_RCU_TORTURE_TEST
9+
=======================
510

611
The CONFIG_RCU_TORTURE_TEST config option is available for all RCU
712
implementations. It creates an rcutorture kernel module that can
@@ -13,9 +18,10 @@ when the module is loaded, and stops when the module is unloaded.
1318
Module parameters are prefixed by "rcutorture." in
1419
Documentation/admin-guide/kernel-parameters.txt.
1520

16-
OUTPUT
21+
Output
22+
======
1723

18-
The statistics output is as follows:
24+
The statistics output is as follows::
1925

2026
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
2127
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
@@ -36,53 +42,53 @@ automatic determination as to whether RCU operated correctly.
3642

3743
The entries are as follows:
3844

39-
o "rtc": The hexadecimal address of the structure currently visible
45+
* "rtc": The hexadecimal address of the structure currently visible
4046
to readers.
4147

42-
o "ver": The number of times since boot that the RCU writer task
48+
* "ver": The number of times since boot that the RCU writer task
4349
has changed the structure visible to readers.
4450

45-
o "tfle": If non-zero, indicates that the "torture freelist"
51+
* "tfle": If non-zero, indicates that the "torture freelist"
4652
containing structures to be placed into the "rtc" area is empty.
4753
This condition is important, since it can fool you into thinking
4854
that RCU is working when it is not. :-/
4955

50-
o "rta": Number of structures allocated from the torture freelist.
56+
* "rta": Number of structures allocated from the torture freelist.
5157

52-
o "rtaf": Number of allocations from the torture freelist that have
58+
* "rtaf": Number of allocations from the torture freelist that have
5359
failed due to the list being empty. It is not unusual for this
5460
to be non-zero, but it is bad for it to be a large fraction of
5561
the value indicated by "rta".
5662

57-
o "rtf": Number of frees into the torture freelist.
63+
* "rtf": Number of frees into the torture freelist.
5864

59-
o "rtmbe": A non-zero value indicates that rcutorture believes that
65+
* "rtmbe": A non-zero value indicates that rcutorture believes that
6066
rcu_assign_pointer() and rcu_dereference() are not working
6167
correctly. This value should be zero.
6268

63-
o "rtbe": A non-zero value indicates that one of the rcu_barrier()
69+
* "rtbe": A non-zero value indicates that one of the rcu_barrier()
6470
family of functions is not working correctly.
6571

66-
o "rtbke": rcutorture was unable to create the real-time kthreads
72+
* "rtbke": rcutorture was unable to create the real-time kthreads
6773
used to force RCU priority inversion. This value should be zero.
6874

69-
o "rtbre": Although rcutorture successfully created the kthreads
75+
* "rtbre": Although rcutorture successfully created the kthreads
7076
used to force RCU priority inversion, it was unable to set them
7177
to the real-time priority level of 1. This value should be zero.
7278

73-
o "rtbf": The number of times that RCU priority boosting failed
79+
* "rtbf": The number of times that RCU priority boosting failed
7480
to resolve RCU priority inversion.
7581

76-
o "rtb": The number of times that rcutorture attempted to force
82+
* "rtb": The number of times that rcutorture attempted to force
7783
an RCU priority inversion condition. If you are testing RCU
7884
priority boosting via the "test_boost" module parameter, this
7985
value should be non-zero.
8086

81-
o "nt": The number of times rcutorture ran RCU read-side code from
87+
* "nt": The number of times rcutorture ran RCU read-side code from
8288
within a timer handler. This value should be non-zero only
8389
if you specified the "irqreader" module parameter.
8490

85-
o "Reader Pipe": Histogram of "ages" of structures seen by readers.
91+
* "Reader Pipe": Histogram of "ages" of structures seen by readers.
8692
If any entries past the first two are non-zero, RCU is broken.
8793
And rcutorture prints the error flag string "!!!" to make sure
8894
you notice. The age of a newly allocated structure is zero,
@@ -94,14 +100,14 @@ o "Reader Pipe": Histogram of "ages" of structures seen by readers.
94100
RCU. If you want to see what it looks like when broken, break
95101
it yourself. ;-)
96102

97-
o "Reader Batch": Another histogram of "ages" of structures seen
103+
* "Reader Batch": Another histogram of "ages" of structures seen
98104
by readers, but in terms of counter flips (or batches) rather
99105
than in terms of grace periods. The legal number of non-zero
100106
entries is again two. The reason for this separate view is that
101107
it is sometimes easier to get the third entry to show up in the
102108
"Reader Batch" list than in the "Reader Pipe" list.
103109

104-
o "Free-Block Circulation": Shows the number of torture structures
110+
* "Free-Block Circulation": Shows the number of torture structures
105111
that have reached a given point in the pipeline. The first element
106112
should closely correspond to the number of structures allocated,
107113
the second to the number that have been removed from reader view,
@@ -112,7 +118,7 @@ o "Free-Block Circulation": Shows the number of torture structures
112118

113119
Different implementations of RCU can provide implementation-specific
114120
additional information. For example, Tree SRCU provides the following
115-
additional line:
121+
additional line::
116122

117123
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)
118124

@@ -123,15 +129,15 @@ using a dynamically allocated srcu_struct (hence "srcud-" rather than
123129
"old" and "current" values to the underlying array, and is useful for
124130
debugging. The final "T" entry contains the totals of the counters.
125131

126-
127-
USAGE ON SPECIFIC KERNEL BUILDS
132+
Usage on Specific Kernel Builds
133+
===============================
128134

129135
It is sometimes desirable to torture RCU on a specific kernel build,
130136
for example, when preparing to put that kernel build into production.
131137
In that case, the kernel should be built with CONFIG_RCU_TORTURE_TEST=m
132138
so that the test can be started using modprobe and terminated using rmmod.
133139

134-
For example, the following script may be used to torture RCU:
140+
For example, the following script may be used to torture RCU::
135141

136142
#!/bin/sh
137143

@@ -148,7 +154,8 @@ two are self-explanatory, while the last indicates that while there
148154
were no RCU failures, CPU-hotplug problems were detected.
149155

150156

151-
USAGE ON MAINLINE KERNELS
157+
Usage on Mainline Kernels
158+
=========================
152159

153160
When using rcutorture to test changes to RCU itself, it is often
154161
necessary to build a number of kernels in order to test that change
@@ -180,16 +187,16 @@ to Tree SRCU might run only the SRCU-N and SRCU-P scenarios using the
180187
--configs argument to kvm.sh as follows: "--configs 'SRCU-N SRCU-P'".
181188
Large systems can run multiple copies of of the full set of scenarios,
182189
for example, a system with 448 hardware threads can run five instances
183-
of the full set concurrently. To make this happen:
190+
of the full set concurrently. To make this happen::
184191

185192
kvm.sh --cpus 448 --configs '5*CFLIST'
186193

187194
Alternatively, such a system can run 56 concurrent instances of a single
188-
eight-CPU scenario:
195+
eight-CPU scenario::
189196

190197
kvm.sh --cpus 448 --configs '56*TREE04'
191198

192-
Or 28 concurrent instances of each of two eight-CPU scenarios:
199+
Or 28 concurrent instances of each of two eight-CPU scenarios::
193200

194201
kvm.sh --cpus 448 --configs '28*TREE03 28*TREE04'
195202

@@ -199,14 +206,14 @@ values for memory may require disabling the callback-flooding tests
199206
using the --bootargs parameter discussed below.
200207

201208
Sometimes additional debugging is useful, and in such cases the --kconfig
202-
parameter to kvm.sh may be used, for example, "--kconfig 'CONFIG_KASAN=y'".
209+
parameter to kvm.sh may be used, for example, ``--kconfig 'CONFIG_KASAN=y'``.
203210

204211
Kernel boot arguments can also be supplied, for example, to control
205212
rcutorture's module parameters. For example, to test a change to RCU's
206213
CPU stall-warning code, use "--bootargs 'rcutorture.stall_cpu=30'".
207214
This will of course result in the scripting reporting a failure, namely
208215
the resuling RCU CPU stall warning. As noted above, reducing memory may
209-
require disabling rcutorture's callback-flooding tests:
216+
require disabling rcutorture's callback-flooding tests::
210217

211218
kvm.sh --cpus 448 --configs '56*TREE04' --memory 128M \
212219
--bootargs 'rcutorture.fwd_progress=0'
@@ -225,7 +232,7 @@ is listed at the end of the kvm.sh output, which you really should redirect
225232
to a file. The build products and console output of each run is kept in
226233
tools/testing/selftests/rcutorture/res in timestamped directories. A
227234
given directory can be supplied to kvm-find-errors.sh in order to have
228-
it cycle you through summaries of errors and full error logs. For example:
235+
it cycle you through summaries of errors and full error logs. For example::
229236

230237
tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh \
231238
tools/testing/selftests/rcutorture/res/2020.01.20-15.54.23
@@ -245,38 +252,42 @@ that was tested and any uncommitted changes in diff format.
245252

246253
The most frequently used files in each per-scenario-run directory are:
247254

248-
.config: This file contains the Kconfig options.
255+
.config:
256+
This file contains the Kconfig options.
249257

250-
Make.out: This contains build output for a specific scenario.
258+
Make.out:
259+
This contains build output for a specific scenario.
251260

252-
console.log: This contains the console output for a specific scenario.
261+
console.log:
262+
This contains the console output for a specific scenario.
253263
This file may be examined once the kernel has booted, but
254264
it might not exist if the build failed.
255265

256-
vmlinux: This contains the kernel, which can be useful with tools like
266+
vmlinux:
267+
This contains the kernel, which can be useful with tools like
257268
objdump and gdb.
258269

259270
A number of additional files are available, but are less frequently used.
260271
Many are intended for debugging of rcutorture itself or of its scripting.
261272

262273
As of v5.4, a successful run with the default set of scenarios produces
263-
the following summary at the end of the run on a 12-CPU system:
264-
265-
SRCU-N ------- 804233 GPs (148.932/s) [srcu: g10008272 f0x0 ]
266-
SRCU-P ------- 202320 GPs (37.4667/s) [srcud: g1809476 f0x0 ]
267-
SRCU-t ------- 1122086 GPs (207.794/s) [srcu: g0 f0x0 ]
268-
SRCU-u ------- 1111285 GPs (205.794/s) [srcud: g1 f0x0 ]
269-
TASKS01 ------- 19666 GPs (3.64185/s) [tasks: g0 f0x0 ]
270-
TASKS02 ------- 20541 GPs (3.80389/s) [tasks: g0 f0x0 ]
271-
TASKS03 ------- 19416 GPs (3.59556/s) [tasks: g0 f0x0 ]
272-
TINY01 ------- 836134 GPs (154.84/s) [rcu: g0 f0x0 ] n_max_cbs: 34198
273-
TINY02 ------- 850371 GPs (157.476/s) [rcu: g0 f0x0 ] n_max_cbs: 2631
274-
TREE01 ------- 162625 GPs (30.1157/s) [rcu: g1124169 f0x0 ]
275-
TREE02 ------- 333003 GPs (61.6672/s) [rcu: g2647753 f0x0 ] n_max_cbs: 35844
276-
TREE03 ------- 306623 GPs (56.782/s) [rcu: g2975325 f0x0 ] n_max_cbs: 1496497
277-
CPU count limited from 16 to 12
278-
TREE04 ------- 246149 GPs (45.5831/s) [rcu: g1695737 f0x0 ] n_max_cbs: 434961
279-
TREE05 ------- 314603 GPs (58.2598/s) [rcu: g2257741 f0x2 ] n_max_cbs: 193997
280-
TREE07 ------- 167347 GPs (30.9902/s) [rcu: g1079021 f0x0 ] n_max_cbs: 478732
281-
CPU count limited from 16 to 12
282-
TREE09 ------- 752238 GPs (139.303/s) [rcu: g13075057 f0x0 ] n_max_cbs: 99011
274+
the following summary at the end of the run on a 12-CPU system::
275+
276+
SRCU-N ------- 804233 GPs (148.932/s) [srcu: g10008272 f0x0 ]
277+
SRCU-P ------- 202320 GPs (37.4667/s) [srcud: g1809476 f0x0 ]
278+
SRCU-t ------- 1122086 GPs (207.794/s) [srcu: g0 f0x0 ]
279+
SRCU-u ------- 1111285 GPs (205.794/s) [srcud: g1 f0x0 ]
280+
TASKS01 ------- 19666 GPs (3.64185/s) [tasks: g0 f0x0 ]
281+
TASKS02 ------- 20541 GPs (3.80389/s) [tasks: g0 f0x0 ]
282+
TASKS03 ------- 19416 GPs (3.59556/s) [tasks: g0 f0x0 ]
283+
TINY01 ------- 836134 GPs (154.84/s) [rcu: g0 f0x0 ] n_max_cbs: 34198
284+
TINY02 ------- 850371 GPs (157.476/s) [rcu: g0 f0x0 ] n_max_cbs: 2631
285+
TREE01 ------- 162625 GPs (30.1157/s) [rcu: g1124169 f0x0 ]
286+
TREE02 ------- 333003 GPs (61.6672/s) [rcu: g2647753 f0x0 ] n_max_cbs: 35844
287+
TREE03 ------- 306623 GPs (56.782/s) [rcu: g2975325 f0x0 ] n_max_cbs: 1496497
288+
CPU count limited from 16 to 12
289+
TREE04 ------- 246149 GPs (45.5831/s) [rcu: g1695737 f0x0 ] n_max_cbs: 434961
290+
TREE05 ------- 314603 GPs (58.2598/s) [rcu: g2257741 f0x2 ] n_max_cbs: 193997
291+
TREE07 ------- 167347 GPs (30.9902/s) [rcu: g1079021 f0x0 ] n_max_cbs: 478732
292+
CPU count limited from 16 to 12
293+
TREE09 ------- 752238 GPs (139.303/s) [rcu: g13075057 f0x0 ] n_max_cbs: 99011

Documentation/locking/locktorture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,4 @@ checked for such errors. The "rmmod" command forces a "SUCCESS",
166166
two are self-explanatory, while the last indicates that while there
167167
were no locking failures, CPU-hotplug problems were detected.
168168

169-
Also see: Documentation/RCU/torture.txt
169+
Also see: Documentation/RCU/torture.rst

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14437,7 +14437,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev
1443714437
F: Documentation/RCU/
1443814438
F: include/linux/rcu*
1443914439
F: kernel/rcu/
14440-
X: Documentation/RCU/torture.txt
14440+
X: Documentation/RCU/torture.rst
1444114441
X: include/linux/srcu*.h
1444214442
X: kernel/rcu/srcu*.c
1444314443

@@ -17288,7 +17288,7 @@ M: Josh Triplett <[email protected]>
1728817288
1728917289
S: Supported
1729017290
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
1729217292
F: kernel/locking/locktorture.c
1729317293
F: kernel/rcu/rcuperf.c
1729417294
F: kernel/rcu/rcutorture.c

kernel/rcu/rcutorture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Authors: Paul E. McKenney <[email protected]>
88
* Josh Triplett <[email protected]>
99
*
10-
* See also: Documentation/RCU/torture.txt
10+
* See also: Documentation/RCU/torture.rst
1111
*/
1212

1313
#define pr_fmt(fmt) fmt

0 commit comments

Comments
 (0)