Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
[pandora-kernel.git] / Documentation / RCU / torture.txt
index a494859..a342b6e 100644 (file)
@@ -10,24 +10,50 @@ status messages via printk(), which can be examined via the dmesg
 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
-running the test immediately upon boot, and ending only when the system
-is taken down.  Normally, one will instead want to build the system
-with CONFIG_RCU_TORTURE_TEST=m and to use modprobe and rmmod to control
-the test, perhaps using a script similar to the one shown at the end of
-this document.  Note that you will need CONFIG_MODULE_UNLOAD in order
-to be able to end the test.
+CONFIG_RCU_TORTURE_TEST_RUNNABLE
+
+It is also possible to specify CONFIG_RCU_TORTURE_TEST=y, which will
+result in the tests being loaded into the base kernel.  In this case,
+the CONFIG_RCU_TORTURE_TEST_RUNNABLE config option is used to specify
+whether the RCU torture tests are to be started immediately during
+boot or whether the /proc/sys/kernel/rcutorture_runnable file is used
+to enable them.  This /proc file can be used to repeatedly pause and
+restart the tests, regardless of the initial state specified by the
+CONFIG_RCU_TORTURE_TEST_RUNNABLE config option.
+
+You will normally -not- want to start the RCU torture tests during boot
+(and thus the default is CONFIG_RCU_TORTURE_TEST_RUNNABLE=n), but doing
+this can sometimes be useful in finding boot-time bugs.
 
 
 MODULE PARAMETERS
 
 This module has the following parameters:
 
+irqreaders     Says to invoke RCU readers from irq level.  This is currently
+               done via timers.  Defaults to "1" for variants of RCU that
+               permit this.  (Or, more accurately, variants of RCU that do
+               -not- permit this know to ignore this variable.)
+
+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.
+
 nreaders       This is the number of RCU reading threads supported.
                The default is twice the number of CPUs.  Why twice?
                To properly exercise RCU implementations with preemptible
                read-side critical sections.
 
+shuffle_interval
+               The number of seconds to keep the test threads affinitied
+               to a particular subset of the CPUs, defaults to 3 seconds.
+               Used in conjunction with test_no_idle_hz.
+
 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,18 +61,23 @@ 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.
+stutter                The length of time to run the test before pausing for this
+               same period of time.  Defaults to "stutter=5", so as
+               to run and pause for (roughly) five-second intervals.
+               Specifying "stutter=0" causes the test to run continuously
+               without pausing, which is the old default behavior.
 
 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.
+               Defaults to omitting this test.
 
-torture_type   The type of RCU to test: "rcu" for the rcu_read_lock()
-               API, "rcu_bh" for the rcu_read_lock_bh() API, and "srcu"
-               for the "srcu_read_lock()" API.
+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.
 
@@ -70,8 +101,6 @@ be evident.  ;-)
 
 The entries are as follows:
 
-o      "ggp": The number of counter flips (or batches) since boot.
-
 o      "rtc": The hexadecimal address of the structure currently visible
        to readers.
 
@@ -105,8 +134,8 @@ o   "Reader Pipe": Histogram of "ages" of structures seen by readers.
 o      "Reader Batch": Another histogram of "ages" of structures seen
        by readers, but in terms of counter flips (or batches) rather
        than in terms of grace periods.  The legal number of non-zero
-       entries is again two.  The reason for this separate view is
-       that it is easier to get the third entry to show up in the
+       entries is again two.  The reason for this separate view is that
+       it is sometimes easier to get the third entry to show up in the
        "Reader Batch" list than in the "Reader Pipe" list.
 
 o      "Free-Block Circulation": Shows the number of torture structures
@@ -118,6 +147,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