fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / Documentation / RCU / torture.txt
index e4c3815..25a3c3f 100644 (file)
@@ -7,7 +7,7 @@ The CONFIG_RCU_TORTURE_TEST config option is available for all RCU
 implementations.  It creates an rcutorture kernel module that can
 be loaded to run a torture test.  The test periodically outputs
 status messages via printk(), which can be examined via the dmesg
-command (perhaps grepping for "rcutorture").  The test is started
+command (perhaps grepping for "torture").  The test is started
 when the module is loaded, and stops when the module is unloaded.
 
 However, actually setting this config option to "y" results in the system
@@ -28,6 +28,15 @@ nreaders     This is the number of RCU reading threads supported.
                To properly exercise RCU implementations with preemptible
                read-side critical sections.
 
+nfakewriters   This is the number of RCU fake writer threads to run.  Fake
+               writer threads repeatedly use the synchronous "wait for
+               current readers" function of the interface selected by
+               torture_type, with a delay between calls to allow for various
+               different numbers of writers running in parallel.
+               nfakewriters defaults to 4, which provides enough parallelism
+               to trigger special cases caused by multiple writers, such as
+               the synchronize_srcu() early return optimization.
+
 stat_interval  The number of seconds between output of torture
                statistics (via printk()).  Regardless of the interval,
                statistics are printed when the module is unloaded.
@@ -35,6 +44,22 @@ stat_interval        The number of seconds between output of torture
                be printed -only- when the module is unloaded, and this
                is the default.
 
+shuffle_interval
+               The number of seconds to keep the test threads affinitied
+               to a particular subset of the CPUs.  Used in conjunction
+               with test_no_idle_hz.
+
+test_no_idle_hz        Whether or not to test the ability of RCU to operate in
+               a kernel that disables the scheduling-clock interrupt to
+               idle CPUs.  Boolean parameter, "1" to test, "0" otherwise.
+
+torture_type   The type of RCU to test: "rcu" for the rcu_read_lock() API,
+               "rcu_sync" for rcu_read_lock() with synchronous reclamation,
+               "rcu_bh" for the rcu_read_lock_bh() API, "rcu_bh_sync" for
+               rcu_read_lock_bh() with synchronous reclamation, "srcu" for
+               the "srcu_read_lock()" API, and "sched" for the use of
+               preempt_disable() together with synchronize_sched().
+
 verbose                Enable debug printk()s.  Default is disabled.
 
 
@@ -42,14 +67,14 @@ OUTPUT
 
 The statistics output is as follows:
 
-       rcutorture: --- Start of test: nreaders=16 stat_interval=0 verbose=0
-       rcutorture: rtc: 0000000000000000 ver: 1916 tfle: 0 rta: 1916 rtaf: 0 rtf: 1915
-       rcutorture: Reader Pipe:  1466408 9747 0 0 0 0 0 0 0 0 0
-       rcutorture: Reader Batch:  1464477 11678 0 0 0 0 0 0 0 0
-       rcutorture: Free-Block Circulation:  1915 1915 1915 1915 1915 1915 1915 1915 1915 1915 0
-       rcutorture: --- End of test
+       rcu-torture: --- Start of test: nreaders=16 stat_interval=0 verbose=0
+       rcu-torture: rtc: 0000000000000000 ver: 1916 tfle: 0 rta: 1916 rtaf: 0 rtf: 1915
+       rcu-torture: Reader Pipe:  1466408 9747 0 0 0 0 0 0 0 0 0
+       rcu-torture: Reader Batch:  1464477 11678 0 0 0 0 0 0 0 0
+       rcu-torture: Free-Block Circulation:  1915 1915 1915 1915 1915 1915 1915 1915 1915 1915 0
+       rcu-torture: --- End of test
 
-The command "dmesg | grep rcutorture:" will extract this information on
+The command "dmesg | grep torture:" will extract this information on
 most systems.  On more esoteric configurations, it may be necessary to
 use other commands to access the output of the printk()s used by
 the RCU torture test.  The printk()s use KERN_ALERT, so they should
@@ -105,6 +130,21 @@ o  "Free-Block Circulation": Shows the number of torture structures
        as it is only incremented if a torture structure's counter
        somehow gets incremented farther than it should.
 
+Different implementations of RCU can provide implementation-specific
+additional information.  For example, SRCU provides the following:
+
+       srcu-torture: rtc: f8cf46a8 ver: 355 tfle: 0 rta: 356 rtaf: 0 rtf: 346 rtmbe: 0
+       srcu-torture: Reader Pipe:  559738 939 0 0 0 0 0 0 0 0 0
+       srcu-torture: Reader Batch:  560434 243 0 0 0 0 0 0 0 0
+       srcu-torture: Free-Block Circulation:  355 354 353 352 351 350 349 348 347 346 0
+       srcu-torture: per-CPU(idx=1): 0(0,1) 1(0,1) 2(0,0) 3(0,1)
+
+The first four lines are similar to those for RCU.  The last line shows
+the per-CPU counter state.  The numbers in parentheses are the values
+of the "old" and "current" counters for the corresponding CPU.  The
+"idx" value maps the "old" and "current" values to the underlying array,
+and is useful for debugging.
+
 
 USAGE
 
@@ -115,8 +155,9 @@ The following script may be used to torture RCU:
        modprobe rcutorture
        sleep 100
        rmmod rcutorture
-       dmesg | grep rcutorture:
+       dmesg | grep torture:
 
 The output can be manually inspected for the error flag of "!!!".
 One could of course create a more elaborate script that automatically
-checked for such errors.
+checked for such errors.  The "rmmod" command forces a "SUCCESS" or
+"FAILURE" indication to be printk()ed.