aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-12-16 05:43:41 -0500
committerIngo Molnar <mingo@kernel.org>2013-12-16 05:43:41 -0500
commit73a7ac2808fa52bdab1781646568b6f90c3d7034 (patch)
treeb3a79f3ce811167c37e9c0e65aeb8a7c70bed4c8
parent319e2e3f63c348a9b66db4667efa73178e18b17d (diff)
parent0d3c55bc9fd58393bd3bd9974991ec1f815e1326 (diff)
Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu
Pull v3.14 RCU updates from Paul E. McKenney. The main changes: * Update RCU documentation. * Miscellaneous fixes. * Add RCU torture scripts. * Static-analysis improvements. Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--Documentation/RCU/trace.txt22
-rw-r--r--Documentation/circular-buffers.txt45
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--include/linux/rculist.h4
-rw-r--r--include/linux/rcupdate.h153
-rw-r--r--include/linux/rcutiny.h2
-rw-r--r--include/linux/rcutree.h36
-rw-r--r--kernel/rcu/rcu.h5
-rw-r--r--kernel/rcu/srcu.c57
-rw-r--r--kernel/rcu/torture.c75
-rw-r--r--kernel/rcu/tree.c79
-rw-r--r--kernel/rcu/tree.h12
-rw-r--r--kernel/rcu/tree_plugin.h89
-rw-r--r--kernel/rcu/tree_trace.c3
-rw-r--r--kernel/rcu/update.c5
-rw-r--r--tools/testing/selftests/rcutorture/.gitignore6
-rw-r--r--tools/testing/selftests/rcutorture/bin/config2frag.sh25
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/configNR_CPUS.sh45
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/configcheck.sh54
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/configinit.sh74
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/cpus2use.sh41
-rw-r--r--tools/testing/selftests/rcutorture/bin/functions.sh198
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-build.sh71
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-recheck.sh44
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh192
-rw-r--r--tools/testing/selftests/rcutorture/bin/kvm.sh210
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-build.sh57
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-console.sh41
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/parse-rcutorture.sh106
-rw-r--r--tools/testing/selftests/rcutorture/configs/CFLIST13
-rw-r--r--tools/testing/selftests/rcutorture/configs/SRCU-N8
-rw-r--r--tools/testing/selftests/rcutorture/configs/SRCU-N.boot1
-rw-r--r--tools/testing/selftests/rcutorture/configs/SRCU-P8
-rw-r--r--tools/testing/selftests/rcutorture/configs/SRCU-P.boot1
-rw-r--r--tools/testing/selftests/rcutorture/configs/TINY0113
-rw-r--r--tools/testing/selftests/rcutorture/configs/TINY0213
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0123
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE01.boot1
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0226
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0323
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0425
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE04.boot1
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0525
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE05.boot1
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0626
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0724
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0826
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE08-T26
-rw-r--r--tools/testing/selftests/rcutorture/configs/TREE0921
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N3-3-T-nh-SD-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N4-A-t-NH-sd-SMP-HP18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/N5-U-T-NH-sd-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/NT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/NT3-NH20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP19
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P3-3-T-nh-SD-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P4-A-t-NH-sd-SMP-HP22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/P5-U-T-NH-sd-SMP-hp28
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/PT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/PT2-NH22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh35
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/CFLIST17
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N1-S-T-NH-SD-SMP-HP19
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N3-3-T-nh-SD-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N4-A-t-NH-sd-SMP-HP18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N5-U-T-NH-sd-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N6---t-nh-SD-smp-hp19
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N7-4-T-NH-SD-SMP-HP26
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/N8-2-T-NH-SD-SMP-HP22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/NT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/NT3-NH20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P1-S-T-NH-SD-SMP-HP20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P3-3-T-nh-SD-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P4-A-t-NH-sd-SMP-HP22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P5-U-T-NH-sd-SMP-hp28
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P6---t-nh-SD-smp-hp18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP30
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-all30
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-none30
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-hp30
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/PT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.12/PT2-NH22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/N1-S-T-NH-SD-SMP-HP19
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/N2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/N3-3-T-nh-SD-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/N4-A-t-NH-sd-SMP-HP18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/N5-U-T-NH-sd-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/NT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/NT3-NH20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/P1-S-T-NH-SD-SMP-HP20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/P2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/P3-3-T-nh-SD-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/P4-A-t-NH-sd-SMP-HP22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/P5-U-T-NH-sd-SMP-hp28
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/PT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/PT2-NH22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh41
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/CFLIST14
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/N1-S-T-NH-SD-SMP-HP19
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/N2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/N3-3-T-nh-SD-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/N4-A-t-NH-sd-SMP-HP18
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/N5-U-T-NH-sd-SMP-hp22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/NT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/NT3-NH20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/P1-S-T-NH-SD-SMP-HP20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/P2-2-t-nh-sd-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/P3-3-T-nh-SD-SMP-hp20
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/P4-A-t-NH-sd-SMP-HP22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/P5-U-T-NH-sd-SMP-hp28
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/PT1-nh23
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/PT2-NH22
-rw-r--r--tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh46
-rw-r--r--tools/testing/selftests/rcutorture/configs/ver_functions.sh46
-rw-r--r--tools/testing/selftests/rcutorture/doc/TINY_RCU.txt40
-rw-r--r--tools/testing/selftests/rcutorture/doc/TREE_RCU-Kconfig.txt95
-rw-r--r--tools/testing/selftests/rcutorture/doc/initrd.txt90
-rw-r--r--tools/testing/selftests/rcutorture/doc/rcu-test-image.txt42
127 files changed, 3768 insertions, 198 deletions
diff --git a/Documentation/RCU/trace.txt b/Documentation/RCU/trace.txt
index f3778f8952da..910870b15acd 100644
--- a/Documentation/RCU/trace.txt
+++ b/Documentation/RCU/trace.txt
@@ -396,14 +396,14 @@ o Each element of the form "3/3 ..>. 0:7 ^0" represents one rcu_node
396 396
397The output of "cat rcu/rcu_sched/rcu_pending" looks as follows: 397The output of "cat rcu/rcu_sched/rcu_pending" looks as follows:
398 398
399 0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903 399 0!np=26111 qsp=29 rpq=5386 cbr=1 cng=570 gpc=3674 gps=577 nn=15903 ndw=0
400 1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113 400 1!np=28913 qsp=35 rpq=6097 cbr=1 cng=448 gpc=3700 gps=554 nn=18113 ndw=0
401 2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889 401 2!np=32740 qsp=37 rpq=6202 cbr=0 cng=476 gpc=4627 gps=546 nn=20889 ndw=0
402 3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469 402 3 np=23679 qsp=22 rpq=5044 cbr=1 cng=415 gpc=3403 gps=347 nn=14469 ndw=0
403 4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042 403 4!np=30714 qsp=4 rpq=5574 cbr=0 cng=528 gpc=3931 gps=639 nn=20042 ndw=0
404 5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422 404 5 np=28910 qsp=2 rpq=5246 cbr=0 cng=428 gpc=4105 gps=709 nn=18422 ndw=0
405 6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699 405 6!np=38648 qsp=5 rpq=7076 cbr=0 cng=840 gpc=4072 gps=961 nn=25699 ndw=0
406 7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147 406 7 np=37275 qsp=2 rpq=6873 cbr=0 cng=868 gpc=3416 gps=971 nn=25147 ndw=0
407 407
408The fields are as follows: 408The fields are as follows:
409 409
@@ -432,6 +432,10 @@ o "gpc" is the number of times that an old grace period had
432o "gps" is the number of times that a new grace period had started, 432o "gps" is the number of times that a new grace period had started,
433 but this CPU was not yet aware of it. 433 but this CPU was not yet aware of it.
434 434
435o "ndw" is the number of times that a wakeup of an rcuo
436 callback-offload kthread had to be deferred in order to avoid
437 deadlock.
438
435o "nn" is the number of times that this CPU needed nothing. 439o "nn" is the number of times that this CPU needed nothing.
436 440
437 441
@@ -443,7 +447,7 @@ The output of "cat rcu/rcuboost" looks as follows:
443 balk: nt=0 egt=6541 bt=0 nb=0 ny=126 nos=0 447 balk: nt=0 egt=6541 bt=0 nb=0 ny=126 nos=0
444 448
445This information is output only for rcu_preempt. Each two-line entry 449This information is output only for rcu_preempt. Each two-line entry
446corresponds to a leaf rcu_node strcuture. The fields are as follows: 450corresponds to a leaf rcu_node structure. The fields are as follows:
447 451
448o "n:m" is the CPU-number range for the corresponding two-line 452o "n:m" is the CPU-number range for the corresponding two-line
449 entry. In the sample output above, the first entry covers 453 entry. In the sample output above, the first entry covers
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt
index 8117e5bf6065..88951b179262 100644
--- a/Documentation/circular-buffers.txt
+++ b/Documentation/circular-buffers.txt
@@ -160,6 +160,7 @@ The producer will look something like this:
160 spin_lock(&producer_lock); 160 spin_lock(&producer_lock);
161 161
162 unsigned long head = buffer->head; 162 unsigned long head = buffer->head;
163 /* The spin_unlock() and next spin_lock() provide needed ordering. */
163 unsigned long tail = ACCESS_ONCE(buffer->tail); 164 unsigned long tail = ACCESS_ONCE(buffer->tail);
164 165
165 if (CIRC_SPACE(head, tail, buffer->size) >= 1) { 166 if (CIRC_SPACE(head, tail, buffer->size) >= 1) {
@@ -168,9 +169,8 @@ The producer will look something like this:
168 169
169 produce_item(item); 170 produce_item(item);
170 171
171 smp_wmb(); /* commit the item before incrementing the head */ 172 smp_store_release(buffer->head,
172 173 (head + 1) & (buffer->size - 1));
173 buffer->head = (head + 1) & (buffer->size - 1);
174 174
175 /* wake_up() will make sure that the head is committed before 175 /* wake_up() will make sure that the head is committed before
176 * waking anyone up */ 176 * waking anyone up */
@@ -183,9 +183,14 @@ This will instruct the CPU that the contents of the new item must be written
183before the head index makes it available to the consumer and then instructs the 183before the head index makes it available to the consumer and then instructs the
184CPU that the revised head index must be written before the consumer is woken. 184CPU that the revised head index must be written before the consumer is woken.
185 185
186Note that wake_up() doesn't have to be the exact mechanism used, but whatever 186Note that wake_up() does not guarantee any sort of barrier unless something
187is used must guarantee a (write) memory barrier between the update of the head 187is actually awakened. We therefore cannot rely on it for ordering. However,
188index and the change of state of the consumer, if a change of state occurs. 188there is always one element of the array left empty. Therefore, the
189producer must produce two elements before it could possibly corrupt the
190element currently being read by the consumer. Therefore, the unlock-lock
191pair between consecutive invocations of the consumer provides the necessary
192ordering between the read of the index indicating that the consumer has
193vacated a given element and the write by the producer to that same element.
189 194
190 195
191THE CONSUMER 196THE CONSUMER
@@ -195,21 +200,20 @@ The consumer will look something like this:
195 200
196 spin_lock(&consumer_lock); 201 spin_lock(&consumer_lock);
197 202
198 unsigned long head = ACCESS_ONCE(buffer->head); 203 /* Read index before reading contents at that index. */
204 unsigned long head = smp_load_acquire(buffer->head);
199 unsigned long tail = buffer->tail; 205 unsigned long tail = buffer->tail;
200 206
201 if (CIRC_CNT(head, tail, buffer->size) >= 1) { 207 if (CIRC_CNT(head, tail, buffer->size) >= 1) {
202 /* read index before reading contents at that index */
203 smp_read_barrier_depends();
204 208
205 /* extract one item from the buffer */ 209 /* extract one item from the buffer */
206 struct item *item = buffer[tail]; 210 struct item *item = buffer[tail];
207 211
208 consume_item(item); 212 consume_item(item);
209 213
210 smp_mb(); /* finish reading descriptor before incrementing tail */ 214 /* Finish reading descriptor before incrementing tail. */
211 215 smp_store_release(buffer->tail,
212 buffer->tail = (tail + 1) & (buffer->size - 1); 216 (tail + 1) & (buffer->size - 1));
213 } 217 }
214 218
215 spin_unlock(&consumer_lock); 219 spin_unlock(&consumer_lock);
@@ -218,12 +222,17 @@ This will instruct the CPU to make sure the index is up to date before reading
218the new item, and then it shall make sure the CPU has finished reading the item 222the new item, and then it shall make sure the CPU has finished reading the item
219before it writes the new tail pointer, which will erase the item. 223before it writes the new tail pointer, which will erase the item.
220 224
221 225Note the use of ACCESS_ONCE() and smp_load_acquire() to read the
222Note the use of ACCESS_ONCE() in both algorithms to read the opposition index. 226opposition index. This prevents the compiler from discarding and
223This prevents the compiler from discarding and reloading its cached value - 227reloading its cached value - which some compilers will do across
224which some compilers will do across smp_read_barrier_depends(). This isn't 228smp_read_barrier_depends(). This isn't strictly needed if you can
225strictly needed if you can be sure that the opposition index will _only_ be 229be sure that the opposition index will _only_ be used the once.
226used the once. 230The smp_load_acquire() additionally forces the CPU to order against
231subsequent memory references. Similarly, smp_store_release() is used
232in both algorithms to write the thread's index. This documents the
233fact that we are writing to something that can be read concurrently,
234prevents the compiler from tearing the store, and enforces ordering
235against previous accesses.
227 236
228 237
229=============== 238===============
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 50680a59a2ff..9063e74ba5c6 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2625,7 +2625,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2625 for RCU-preempt, and "s" for RCU-sched, and "N" 2625 for RCU-preempt, and "s" for RCU-sched, and "N"
2626 is the CPU number. This reduces OS jitter on the 2626 is the CPU number. This reduces OS jitter on the
2627 offloaded CPUs, which can be useful for HPC and 2627 offloaded CPUs, which can be useful for HPC and
2628
2629 real-time workloads. It can also improve energy 2628 real-time workloads. It can also improve energy
2630 efficiency for asymmetric multiprocessors. 2629 efficiency for asymmetric multiprocessors.
2631 2630
@@ -2641,8 +2640,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2641 periodically wake up to do the polling. 2640 periodically wake up to do the polling.
2642 2641
2643 rcutree.blimit= [KNL] 2642 rcutree.blimit= [KNL]
2644 Set maximum number of finished RCU callbacks to process 2643 Set maximum number of finished RCU callbacks to
2645 in one batch. 2644 process in one batch.
2646 2645
2647 rcutree.rcu_fanout_leaf= [KNL] 2646 rcutree.rcu_fanout_leaf= [KNL]
2648 Increase the number of CPUs assigned to each 2647 Increase the number of CPUs assigned to each
@@ -2661,8 +2660,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2661 value is one, and maximum value is HZ. 2660 value is one, and maximum value is HZ.
2662 2661
2663 rcutree.qhimark= [KNL] 2662 rcutree.qhimark= [KNL]
2664 Set threshold of queued 2663 Set threshold of queued RCU callbacks beyond which
2665 RCU callbacks over which batch limiting is disabled. 2664 batch limiting is disabled.
2666 2665
2667 rcutree.qlowmark= [KNL] 2666 rcutree.qlowmark= [KNL]
2668 Set threshold of queued RCU callbacks below which 2667 Set threshold of queued RCU callbacks below which
diff --git a/MAINTAINERS b/MAINTAINERS
index 1344816c4c06..616b95134710 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7075,6 +7075,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
7075F: Documentation/RCU/torture.txt 7075F: Documentation/RCU/torture.txt
7076F: kernel/rcu/torture.c 7076F: kernel/rcu/torture.c
7077 7077
7078RCUTORTURE TEST FRAMEWORK
7079M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7080S: Supported
7081T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
7082F: tools/testing/selftests/rcutorture
7083
7078RDC R-321X SoC 7084RDC R-321X SoC
7079M: Florian Fainelli <florian@openwrt.org> 7085M: Florian Fainelli <florian@openwrt.org>
7080S: Maintained 7086S: Maintained
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 398e299ee1bd..698077b2ad0b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1763,7 +1763,7 @@ static int __bond_release_one(struct net_device *bond_dev,
1763 } 1763 }
1764 1764
1765 if (all) { 1765 if (all) {
1766 rcu_assign_pointer(bond->curr_active_slave, NULL); 1766 RCU_INIT_POINTER(bond->curr_active_slave, NULL);
1767 } else if (oldcurrent == slave) { 1767 } else if (oldcurrent == slave) {
1768 /* 1768 /*
1769 * Note that we hold RTNL over this sequence, so there 1769 * Note that we hold RTNL over this sequence, so there
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index 45a0a9e81478..dbaf99084112 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -55,8 +55,8 @@ static inline void __list_add_rcu(struct list_head *new,
55 next->prev = new; 55 next->prev = new;
56} 56}
57#else 57#else
58extern void __list_add_rcu(struct list_head *new, 58void __list_add_rcu(struct list_head *new,
59 struct list_head *prev, struct list_head *next); 59 struct list_head *prev, struct list_head *next);
60#endif 60#endif
61 61
62/** 62/**
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 39cbb889e20d..3e355c688618 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -50,13 +50,13 @@ extern int rcutorture_runnable; /* for sysctl */
50#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ 50#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
51 51
52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
53extern void rcutorture_record_test_transition(void); 53void rcutorture_record_test_transition(void);
54extern void rcutorture_record_progress(unsigned long vernum); 54void rcutorture_record_progress(unsigned long vernum);
55extern void do_trace_rcu_torture_read(const char *rcutorturename, 55void do_trace_rcu_torture_read(const char *rcutorturename,
56 struct rcu_head *rhp, 56 struct rcu_head *rhp,
57 unsigned long secs, 57 unsigned long secs,
58 unsigned long c_old, 58 unsigned long c_old,
59 unsigned long c); 59 unsigned long c);
60#else 60#else
61static inline void rcutorture_record_test_transition(void) 61static inline void rcutorture_record_test_transition(void)
62{ 62{
@@ -65,11 +65,11 @@ static inline void rcutorture_record_progress(unsigned long vernum)
65{ 65{
66} 66}
67#ifdef CONFIG_RCU_TRACE 67#ifdef CONFIG_RCU_TRACE
68extern void do_trace_rcu_torture_read(const char *rcutorturename, 68void do_trace_rcu_torture_read(const char *rcutorturename,
69 struct rcu_head *rhp, 69 struct rcu_head *rhp,
70 unsigned long secs, 70 unsigned long secs,
71 unsigned long c_old, 71 unsigned long c_old,
72 unsigned long c); 72 unsigned long c);
73#else 73#else
74#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \ 74#define do_trace_rcu_torture_read(rcutorturename, rhp, secs, c_old, c) \
75 do { } while (0) 75 do { } while (0)
@@ -118,8 +118,8 @@ extern void do_trace_rcu_torture_read(const char *rcutorturename,
118 * if CPU A and CPU B are the same CPU (but again only if the system has 118 * if CPU A and CPU B are the same CPU (but again only if the system has
119 * more than one CPU). 119 * more than one CPU).
120 */ 120 */
121extern void call_rcu(struct rcu_head *head, 121void call_rcu(struct rcu_head *head,
122 void (*func)(struct rcu_head *head)); 122 void (*func)(struct rcu_head *head));
123 123
124#else /* #ifdef CONFIG_PREEMPT_RCU */ 124#else /* #ifdef CONFIG_PREEMPT_RCU */
125 125
@@ -149,8 +149,8 @@ extern void call_rcu(struct rcu_head *head,
149 * See the description of call_rcu() for more detailed information on 149 * See the description of call_rcu() for more detailed information on
150 * memory ordering guarantees. 150 * memory ordering guarantees.
151 */ 151 */
152extern void call_rcu_bh(struct rcu_head *head, 152void call_rcu_bh(struct rcu_head *head,
153 void (*func)(struct rcu_head *head)); 153 void (*func)(struct rcu_head *head));
154 154
155/** 155/**
156 * call_rcu_sched() - Queue an RCU for invocation after sched grace period. 156 * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
@@ -171,16 +171,16 @@ extern void call_rcu_bh(struct rcu_head *head,
171 * See the description of call_rcu() for more detailed information on 171 * See the description of call_rcu() for more detailed information on
172 * memory ordering guarantees. 172 * memory ordering guarantees.
173 */ 173 */
174extern void call_rcu_sched(struct rcu_head *head, 174void call_rcu_sched(struct rcu_head *head,
175 void (*func)(struct rcu_head *rcu)); 175 void (*func)(struct rcu_head *rcu));
176 176
177extern void synchronize_sched(void); 177void synchronize_sched(void);
178 178
179#ifdef CONFIG_PREEMPT_RCU 179#ifdef CONFIG_PREEMPT_RCU
180 180
181extern void __rcu_read_lock(void); 181void __rcu_read_lock(void);
182extern void __rcu_read_unlock(void); 182void __rcu_read_unlock(void);
183extern void rcu_read_unlock_special(struct task_struct *t); 183void rcu_read_unlock_special(struct task_struct *t);
184void synchronize_rcu(void); 184void synchronize_rcu(void);
185 185
186/* 186/*
@@ -216,19 +216,19 @@ static inline int rcu_preempt_depth(void)
216#endif /* #else #ifdef CONFIG_PREEMPT_RCU */ 216#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
217 217
218/* Internal to kernel */ 218/* Internal to kernel */
219extern void rcu_init(void); 219void rcu_init(void);
220extern void rcu_sched_qs(int cpu); 220void rcu_sched_qs(int cpu);
221extern void rcu_bh_qs(int cpu); 221void rcu_bh_qs(int cpu);
222extern void rcu_check_callbacks(int cpu, int user); 222void rcu_check_callbacks(int cpu, int user);
223struct notifier_block; 223struct notifier_block;
224extern void rcu_idle_enter(void); 224void rcu_idle_enter(void);
225extern void rcu_idle_exit(void); 225void rcu_idle_exit(void);
226extern void rcu_irq_enter(void); 226void rcu_irq_enter(void);
227extern void rcu_irq_exit(void); 227void rcu_irq_exit(void);
228 228
229#ifdef CONFIG_RCU_USER_QS 229#ifdef CONFIG_RCU_USER_QS
230extern void rcu_user_enter(void); 230void rcu_user_enter(void);
231extern void rcu_user_exit(void); 231void rcu_user_exit(void);
232#else 232#else
233static inline void rcu_user_enter(void) { } 233static inline void rcu_user_enter(void) { }
234static inline void rcu_user_exit(void) { } 234static inline void rcu_user_exit(void) { }
@@ -262,7 +262,7 @@ static inline void rcu_user_hooks_switch(struct task_struct *prev,
262 } while (0) 262 } while (0)
263 263
264#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) 264#if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP)
265extern bool __rcu_is_watching(void); 265bool __rcu_is_watching(void);
266#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */ 266#endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_RCU_TRACE) || defined(CONFIG_SMP) */
267 267
268/* 268/*
@@ -289,8 +289,8 @@ void wait_rcu_gp(call_rcu_func_t crf);
289 * initialization. 289 * initialization.
290 */ 290 */
291#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD 291#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
292extern void init_rcu_head_on_stack(struct rcu_head *head); 292void init_rcu_head_on_stack(struct rcu_head *head);
293extern void destroy_rcu_head_on_stack(struct rcu_head *head); 293void destroy_rcu_head_on_stack(struct rcu_head *head);
294#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 294#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
295static inline void init_rcu_head_on_stack(struct rcu_head *head) 295static inline void init_rcu_head_on_stack(struct rcu_head *head)
296{ 296{
@@ -325,6 +325,7 @@ static inline void rcu_lock_release(struct lockdep_map *map)
325extern struct lockdep_map rcu_lock_map; 325extern struct lockdep_map rcu_lock_map;
326extern struct lockdep_map rcu_bh_lock_map; 326extern struct lockdep_map rcu_bh_lock_map;
327extern struct lockdep_map rcu_sched_lock_map; 327extern struct lockdep_map rcu_sched_lock_map;
328extern struct lockdep_map rcu_callback_map;
328extern int debug_lockdep_rcu_enabled(void); 329extern int debug_lockdep_rcu_enabled(void);
329 330
330/** 331/**
@@ -362,7 +363,7 @@ static inline int rcu_read_lock_held(void)
362 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file 363 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
363 * hell. 364 * hell.
364 */ 365 */
365extern int rcu_read_lock_bh_held(void); 366int rcu_read_lock_bh_held(void);
366 367
367/** 368/**
368 * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section? 369 * rcu_read_lock_sched_held() - might we be in RCU-sched read-side critical section?
@@ -448,7 +449,7 @@ static inline int rcu_read_lock_sched_held(void)
448 449
449#ifdef CONFIG_PROVE_RCU 450#ifdef CONFIG_PROVE_RCU
450 451
451extern int rcu_my_thread_group_empty(void); 452int rcu_my_thread_group_empty(void);
452 453
453/** 454/**
454 * rcu_lockdep_assert - emit lockdep splat if specified condition not met 455 * rcu_lockdep_assert - emit lockdep splat if specified condition not met
@@ -548,10 +549,48 @@ static inline void rcu_preempt_sleep_check(void)
548 smp_read_barrier_depends(); \ 549 smp_read_barrier_depends(); \
549 (_________p1); \ 550 (_________p1); \
550 }) 551 })
551#define __rcu_assign_pointer(p, v, space) \ 552
553/**
554 * RCU_INITIALIZER() - statically initialize an RCU-protected global variable
555 * @v: The value to statically initialize with.
556 */
557#define RCU_INITIALIZER(v) (typeof(*(v)) __force __rcu *)(v)
558
559/**
560 * rcu_assign_pointer() - assign to RCU-protected pointer
561 * @p: pointer to assign to
562 * @v: value to assign (publish)
563 *
564 * Assigns the specified value to the specified RCU-protected
565 * pointer, ensuring that any concurrent RCU readers will see
566 * any prior initialization.
567 *
568 * Inserts memory barriers on architectures that require them
569 * (which is most of them), and also prevents the compiler from
570 * reordering the code that initializes the structure after the pointer
571 * assignment. More importantly, this call documents which pointers
572 * will be dereferenced by RCU read-side code.
573 *
574 * In some special cases, you may use RCU_INIT_POINTER() instead
575 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
576 * to the fact that it does not constrain either the CPU or the compiler.
577 * That said, using RCU_INIT_POINTER() when you should have used
578 * rcu_assign_pointer() is a very bad thing that results in
579 * impossible-to-diagnose memory corruption. So please be careful.
580 * See the RCU_INIT_POINTER() comment header for details.
581 *
582 * Note that rcu_assign_pointer() evaluates each of its arguments only
583 * once, appearances notwithstanding. One of the "extra" evaluations
584 * is in typeof() and the other visible only to sparse (__CHECKER__),
585 * neither of which actually execute the argument. As with most cpp
586 * macros, this execute-arguments-only-once property is important, so
587 * please be careful when making changes to rcu_assign_pointer() and the
588 * other macros that it invokes.
589 */
590#define rcu_assign_pointer(p, v) \
552 do { \ 591 do { \
553 smp_wmb(); \ 592 smp_wmb(); \
554 (p) = (typeof(*v) __force space *)(v); \ 593 ACCESS_ONCE(p) = RCU_INITIALIZER(v); \
555 } while (0) 594 } while (0)
556 595
557 596
@@ -890,32 +929,6 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
890} 929}
891 930
892/** 931/**
893 * rcu_assign_pointer() - assign to RCU-protected pointer
894 * @p: pointer to assign to
895 * @v: value to assign (publish)
896 *
897 * Assigns the specified value to the specified RCU-protected
898 * pointer, ensuring that any concurrent RCU readers will see
899 * any prior initialization.
900 *
901 * Inserts memory barriers on architectures that require them
902 * (which is most of them), and also prevents the compiler from
903 * reordering the code that initializes the structure after the pointer
904 * assignment. More importantly, this call documents which pointers
905 * will be dereferenced by RCU read-side code.
906 *
907 * In some special cases, you may use RCU_INIT_POINTER() instead
908 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
909 * to the fact that it does not constrain either the CPU or the compiler.
910 * That said, using RCU_INIT_POINTER() when you should have used
911 * rcu_assign_pointer() is a very bad thing that results in
912 * impossible-to-diagnose memory corruption. So please be careful.
913 * See the RCU_INIT_POINTER() comment header for details.
914 */
915#define rcu_assign_pointer(p, v) \
916 __rcu_assign_pointer((p), (v), __rcu)
917
918/**
919 * RCU_INIT_POINTER() - initialize an RCU protected pointer 932 * RCU_INIT_POINTER() - initialize an RCU protected pointer
920 * 933 *
921 * Initialize an RCU-protected pointer in special cases where readers 934 * Initialize an RCU-protected pointer in special cases where readers
@@ -949,7 +962,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
949 */ 962 */
950#define RCU_INIT_POINTER(p, v) \ 963#define RCU_INIT_POINTER(p, v) \
951 do { \ 964 do { \
952 p = (typeof(*v) __force __rcu *)(v); \ 965 p = RCU_INITIALIZER(v); \
953 } while (0) 966 } while (0)
954 967
955/** 968/**
@@ -958,7 +971,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
958 * GCC-style initialization for an RCU-protected pointer in a structure field. 971 * GCC-style initialization for an RCU-protected pointer in a structure field.
959 */ 972 */
960#define RCU_POINTER_INITIALIZER(p, v) \ 973#define RCU_POINTER_INITIALIZER(p, v) \
961 .p = (typeof(*v) __force __rcu *)(v) 974 .p = RCU_INITIALIZER(v)
962 975
963/* 976/*
964 * Does the specified offset indicate that the corresponding rcu_head 977 * Does the specified offset indicate that the corresponding rcu_head
@@ -1005,7 +1018,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
1005 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head)) 1018 __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))
1006 1019
1007#ifdef CONFIG_RCU_NOCB_CPU 1020#ifdef CONFIG_RCU_NOCB_CPU
1008extern bool rcu_is_nocb_cpu(int cpu); 1021bool rcu_is_nocb_cpu(int cpu);
1009#else 1022#else
1010static inline bool rcu_is_nocb_cpu(int cpu) { return false; } 1023static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1011#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ 1024#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
@@ -1013,8 +1026,8 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1013 1026
1014/* Only for use by adaptive-ticks code. */ 1027/* Only for use by adaptive-ticks code. */
1015#ifdef CONFIG_NO_HZ_FULL_SYSIDLE 1028#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
1016extern bool rcu_sys_is_idle(void); 1029bool rcu_sys_is_idle(void);
1017extern void rcu_sysidle_force_exit(void); 1030void rcu_sysidle_force_exit(void);
1018#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ 1031#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1019 1032
1020static inline bool rcu_sys_is_idle(void) 1033static inline bool rcu_sys_is_idle(void)
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 09ebcbe9fd78..6f01771b571c 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -125,7 +125,7 @@ static inline void exit_rcu(void)
125 125
126#ifdef CONFIG_DEBUG_LOCK_ALLOC 126#ifdef CONFIG_DEBUG_LOCK_ALLOC
127extern int rcu_scheduler_active __read_mostly; 127extern int rcu_scheduler_active __read_mostly;
128extern void rcu_scheduler_starting(void); 128void rcu_scheduler_starting(void);
129#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 129#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
130static inline void rcu_scheduler_starting(void) 130static inline void rcu_scheduler_starting(void)
131{ 131{
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 4b9c81548742..72137ee8c603 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -30,9 +30,9 @@
30#ifndef __LINUX_RCUTREE_H 30#ifndef __LINUX_RCUTREE_H
31#define __LINUX_RCUTREE_H 31#define __LINUX_RCUTREE_H
32 32
33extern void rcu_note_context_switch(int cpu); 33void rcu_note_context_switch(int cpu);
34extern int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies); 34int rcu_needs_cpu(int cpu, unsigned long *delta_jiffies);
35extern void rcu_cpu_stall_reset(void); 35void rcu_cpu_stall_reset(void);
36 36
37/* 37/*
38 * Note a virtualization-based context switch. This is simply a 38 * Note a virtualization-based context switch. This is simply a
@@ -44,9 +44,9 @@ static inline void rcu_virt_note_context_switch(int cpu)
44 rcu_note_context_switch(cpu); 44 rcu_note_context_switch(cpu);
45} 45}
46 46
47extern void synchronize_rcu_bh(void); 47void synchronize_rcu_bh(void);
48extern void synchronize_sched_expedited(void); 48void synchronize_sched_expedited(void);
49extern void synchronize_rcu_expedited(void); 49void synchronize_rcu_expedited(void);
50 50
51void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); 51void kfree_call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
52 52
@@ -71,25 +71,25 @@ static inline void synchronize_rcu_bh_expedited(void)
71 synchronize_sched_expedited(); 71 synchronize_sched_expedited();
72} 72}
73 73
74extern void rcu_barrier(void); 74void rcu_barrier(void);
75extern void rcu_barrier_bh(void); 75void rcu_barrier_bh(void);
76extern void rcu_barrier_sched(void); 76void rcu_barrier_sched(void);
77 77
78extern unsigned long rcutorture_testseq; 78extern unsigned long rcutorture_testseq;
79extern unsigned long rcutorture_vernum; 79extern unsigned long rcutorture_vernum;
80extern long rcu_batches_completed(void); 80long rcu_batches_completed(void);
81extern long rcu_batches_completed_bh(void); 81long rcu_batches_completed_bh(void);
82extern long rcu_batches_completed_sched(void); 82long rcu_batches_completed_sched(void);
83 83
84extern void rcu_force_quiescent_state(void); 84void rcu_force_quiescent_state(void);
85extern void rcu_bh_force_quiescent_state(void); 85void rcu_bh_force_quiescent_state(void);
86extern void rcu_sched_force_quiescent_state(void); 86void rcu_sched_force_quiescent_state(void);
87 87
88extern void exit_rcu(void); 88void exit_rcu(void);
89 89
90extern void rcu_scheduler_starting(void); 90void rcu_scheduler_starting(void);
91extern int rcu_scheduler_active __read_mostly; 91extern int rcu_scheduler_active __read_mostly;
92 92
93extern bool rcu_is_watching(void); 93bool rcu_is_watching(void);
94 94
95#endif /* __LINUX_RCUTREE_H */ 95#endif /* __LINUX_RCUTREE_H */
diff --git a/kernel/rcu/rcu.h b/kernel/rcu/rcu.h
index 7859a0a3951e..79c3877e9c5b 100644
--- a/kernel/rcu/rcu.h
+++ b/kernel/rcu/rcu.h
@@ -96,19 +96,22 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head)
96} 96}
97#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 97#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
98 98
99extern void kfree(const void *); 99void kfree(const void *);
100 100
101static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head) 101static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head)
102{ 102{
103 unsigned long offset = (unsigned long)head->func; 103 unsigned long offset = (unsigned long)head->func;
104 104
105 rcu_lock_acquire(&rcu_callback_map);
105 if (__is_kfree_rcu_offset(offset)) { 106 if (__is_kfree_rcu_offset(offset)) {
106 RCU_TRACE(trace_rcu_invoke_kfree_callback(rn, head, offset)); 107 RCU_TRACE(trace_rcu_invoke_kfree_callback(rn, head, offset));
107 kfree((void *)head - offset); 108 kfree((void *)head - offset);
109 rcu_lock_release(&rcu_callback_map);
108 return 1; 110 return 1;
109 } else { 111 } else {
110 RCU_TRACE(trace_rcu_invoke_callback(rn, head)); 112 RCU_TRACE(trace_rcu_invoke_callback(rn, head));
111 head->func(head); 113 head->func(head);
114 rcu_lock_release(&rcu_callback_map);
112 return 0; 115 return 0;
113 } 116 }
114} 117}
diff --git a/kernel/rcu/srcu.c b/kernel/rcu/srcu.c
index 01d5ccb8bfe3..3318d8284384 100644
--- a/kernel/rcu/srcu.c
+++ b/kernel/rcu/srcu.c
@@ -363,6 +363,29 @@ static void srcu_flip(struct srcu_struct *sp)
363/* 363/*
364 * Enqueue an SRCU callback on the specified srcu_struct structure, 364 * Enqueue an SRCU callback on the specified srcu_struct structure,
365 * initiating grace-period processing if it is not already running. 365 * initiating grace-period processing if it is not already running.
366 *
367 * Note that all CPUs must agree that the grace period extended beyond
368 * all pre-existing SRCU read-side critical section. On systems with
369 * more than one CPU, this means that when "func()" is invoked, each CPU
370 * is guaranteed to have executed a full memory barrier since the end of
371 * its last corresponding SRCU read-side critical section whose beginning
372 * preceded the call to call_rcu(). It also means that each CPU executing
373 * an SRCU read-side critical section that continues beyond the start of
374 * "func()" must have executed a memory barrier after the call_rcu()
375 * but before the beginning of that SRCU read-side critical section.
376 * Note that these guarantees include CPUs that are offline, idle, or
377 * executing in user mode, as well as CPUs that are executing in the kernel.
378 *
379 * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the
380 * resulting SRCU callback function "func()", then both CPU A and CPU
381 * B are guaranteed to execute a full memory barrier during the time
382 * interval between the call to call_rcu() and the invocation of "func()".
383 * This guarantee applies even if CPU A and CPU B are the same CPU (but
384 * again only if the system has more than one CPU).
385 *
386 * Of course, these guarantees apply only for invocations of call_srcu(),
387 * srcu_read_lock(), and srcu_read_unlock() that are all passed the same
388 * srcu_struct structure.
366 */ 389 */
367void call_srcu(struct srcu_struct *sp, struct rcu_head *head, 390void call_srcu(struct srcu_struct *sp, struct rcu_head *head,
368 void (*func)(struct rcu_head *head)) 391 void (*func)(struct rcu_head *head))
@@ -459,7 +482,30 @@ static void __synchronize_srcu(struct srcu_struct *sp, int trycount)
459 * Note that it is illegal to call synchronize_srcu() from the corresponding 482 * Note that it is illegal to call synchronize_srcu() from the corresponding
460 * SRCU read-side critical section; doing so will result in deadlock. 483 * SRCU read-side critical section; doing so will result in deadlock.
461 * However, it is perfectly legal to call synchronize_srcu() on one 484 * However, it is perfectly legal to call synchronize_srcu() on one
462 * srcu_struct from some other srcu_struct's read-side critical section. 485 * srcu_struct from some other srcu_struct's read-side critical section,
486 * as long as the resulting graph of srcu_structs is acyclic.
487 *
488 * There are memory-ordering constraints implied by synchronize_srcu().
489 * On systems with more than one CPU, when synchronize_srcu() returns,
490 * each CPU is guaranteed to have executed a full memory barrier since
491 * the end of its last corresponding SRCU-sched read-side critical section
492 * whose beginning preceded the call to synchronize_srcu(). In addition,
493 * each CPU having an SRCU read-side critical section that extends beyond
494 * the return from synchronize_srcu() is guaranteed to have executed a
495 * full memory barrier after the beginning of synchronize_srcu() and before
496 * the beginning of that SRCU read-side critical section. Note that these
497 * guarantees include CPUs that are offline, idle, or executing in user mode,
498 * as well as CPUs that are executing in the kernel.
499 *
500 * Furthermore, if CPU A invoked synchronize_srcu(), which returned
501 * to its caller on CPU B, then both CPU A and CPU B are guaranteed
502 * to have executed a full memory barrier during the execution of
503 * synchronize_srcu(). This guarantee applies even if CPU A and CPU B
504 * are the same CPU, but again only if the system has more than one CPU.
505 *
506 * Of course, these memory-ordering guarantees apply only when
507 * synchronize_srcu(), srcu_read_lock(), and srcu_read_unlock() are
508 * passed the same srcu_struct structure.
463 */ 509 */
464void synchronize_srcu(struct srcu_struct *sp) 510void synchronize_srcu(struct srcu_struct *sp)
465{ 511{
@@ -476,12 +522,8 @@ EXPORT_SYMBOL_GPL(synchronize_srcu);
476 * Wait for an SRCU grace period to elapse, but be more aggressive about 522 * Wait for an SRCU grace period to elapse, but be more aggressive about
477 * spinning rather than blocking when waiting. 523 * spinning rather than blocking when waiting.
478 * 524 *
479 * Note that it is also illegal to call synchronize_srcu_expedited() 525 * Note that synchronize_srcu_expedited() has the same deadlock and
480 * from the corresponding SRCU read-side critical section; 526 * memory-ordering properties as does synchronize_srcu().
481 * doing so will result in deadlock. However, it is perfectly legal
482 * to call synchronize_srcu_expedited() on one srcu_struct from some
483 * other srcu_struct's read-side critical section, as long as
484 * the resulting graph of srcu_structs is acyclic.
485 */ 527 */
486void synchronize_srcu_expedited(struct srcu_struct *sp) 528void synchronize_srcu_expedited(struct srcu_struct *sp)
487{ 529{
@@ -491,6 +533,7 @@ EXPORT_SYMBOL_GPL(synchronize_srcu_expedited);
491 533
492/** 534/**
493 * srcu_barrier - Wait until all in-flight call_srcu() callbacks complete. 535 * srcu_barrier - Wait until all in-flight call_srcu() callbacks complete.
536 * @sp: srcu_struct on which to wait for in-flight callbacks.
494 */ 537 */
495void srcu_barrier(struct srcu_struct *sp) 538void srcu_barrier(struct srcu_struct *sp)
496{ 539{
diff --git a/kernel/rcu/torture.c b/kernel/rcu/torture.c
index 3929cd451511..732f8ae3086a 100644
--- a/kernel/rcu/torture.c
+++ b/kernel/rcu/torture.c
@@ -139,8 +139,6 @@ MODULE_PARM_DESC(verbose, "Enable verbose debugging printk()s");
139#define VERBOSE_PRINTK_ERRSTRING(s) \ 139#define VERBOSE_PRINTK_ERRSTRING(s) \
140 do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0) 140 do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0)
141 141
142static char printk_buf[4096];
143
144static int nrealreaders; 142static int nrealreaders;
145static struct task_struct *writer_task; 143static struct task_struct *writer_task;
146static struct task_struct **fakewriter_tasks; 144static struct task_struct **fakewriter_tasks;
@@ -376,7 +374,7 @@ struct rcu_torture_ops {
376 void (*call)(struct rcu_head *head, void (*func)(struct rcu_head *rcu)); 374 void (*call)(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
377 void (*cb_barrier)(void); 375 void (*cb_barrier)(void);
378 void (*fqs)(void); 376 void (*fqs)(void);
379 int (*stats)(char *page); 377 void (*stats)(char *page);
380 int irq_capable; 378 int irq_capable;
381 int can_boost; 379 int can_boost;
382 const char *name; 380 const char *name;
@@ -578,21 +576,19 @@ static void srcu_torture_barrier(void)
578 srcu_barrier(&srcu_ctl); 576 srcu_barrier(&srcu_ctl);
579} 577}
580 578
581static int srcu_torture_stats(char *page) 579static void srcu_torture_stats(char *page)
582{ 580{
583 int cnt = 0;
584 int cpu; 581 int cpu;
585 int idx = srcu_ctl.completed & 0x1; 582 int idx = srcu_ctl.completed & 0x1;
586 583
587 cnt += sprintf(&page[cnt], "%s%s per-CPU(idx=%d):", 584 page += sprintf(page, "%s%s per-CPU(idx=%d):",
588 torture_type, TORTURE_FLAG, idx); 585 torture_type, TORTURE_FLAG, idx);
589 for_each_possible_cpu(cpu) { 586 for_each_possible_cpu(cpu) {
590 cnt += sprintf(&page[cnt], " %d(%lu,%lu)", cpu, 587 page += sprintf(page, " %d(%lu,%lu)", cpu,
591 per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx], 588 per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[!idx],
592 per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]); 589 per_cpu_ptr(srcu_ctl.per_cpu_ref, cpu)->c[idx]);
593 } 590 }
594 cnt += sprintf(&page[cnt], "\n"); 591 sprintf(page, "\n");
595 return cnt;
596} 592}
597 593
598static void srcu_torture_synchronize_expedited(void) 594static void srcu_torture_synchronize_expedited(void)
@@ -1052,10 +1048,9 @@ rcu_torture_reader(void *arg)
1052/* 1048/*
1053 * Create an RCU-torture statistics message in the specified buffer. 1049 * Create an RCU-torture statistics message in the specified buffer.
1054 */ 1050 */
1055static int 1051static void
1056rcu_torture_printk(char *page) 1052rcu_torture_printk(char *page)
1057{ 1053{
1058 int cnt = 0;
1059 int cpu; 1054 int cpu;
1060 int i; 1055 int i;
1061 long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 }; 1056 long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 };
@@ -1071,8 +1066,8 @@ rcu_torture_printk(char *page)
1071 if (pipesummary[i] != 0) 1066 if (pipesummary[i] != 0)
1072 break; 1067 break;
1073 } 1068 }
1074 cnt += sprintf(&page[cnt], "%s%s ", torture_type, TORTURE_FLAG); 1069 page += sprintf(page, "%s%s ", torture_type, TORTURE_FLAG);
1075 cnt += sprintf(&page[cnt], 1070 page += sprintf(page,
1076 "rtc: %p ver: %lu tfle: %d rta: %d rtaf: %d rtf: %d ", 1071 "rtc: %p ver: %lu tfle: %d rta: %d rtaf: %d rtf: %d ",
1077 rcu_torture_current, 1072 rcu_torture_current,
1078 rcu_torture_current_version, 1073 rcu_torture_current_version,
@@ -1080,53 +1075,52 @@ rcu_torture_printk(char *page)
1080 atomic_read(&n_rcu_torture_alloc), 1075 atomic_read(&n_rcu_torture_alloc),
1081 atomic_read(&n_rcu_torture_alloc_fail), 1076 atomic_read(&n_rcu_torture_alloc_fail),
1082 atomic_read(&n_rcu_torture_free)); 1077 atomic_read(&n_rcu_torture_free));
1083 cnt += sprintf(&page[cnt], "rtmbe: %d rtbke: %ld rtbre: %ld ", 1078 page += sprintf(page, "rtmbe: %d rtbke: %ld rtbre: %ld ",
1084 atomic_read(&n_rcu_torture_mberror), 1079 atomic_read(&n_rcu_torture_mberror),
1085 n_rcu_torture_boost_ktrerror, 1080 n_rcu_torture_boost_ktrerror,
1086 n_rcu_torture_boost_rterror); 1081 n_rcu_torture_boost_rterror);
1087 cnt += sprintf(&page[cnt], "rtbf: %ld rtb: %ld nt: %ld ", 1082 page += sprintf(page, "rtbf: %ld rtb: %ld nt: %ld ",
1088 n_rcu_torture_boost_failure, 1083 n_rcu_torture_boost_failure,
1089 n_rcu_torture_boosts, 1084 n_rcu_torture_boosts,
1090 n_rcu_torture_timers); 1085 n_rcu_torture_timers);
1091 cnt += sprintf(&page[cnt], 1086 page += sprintf(page,
1092 "onoff: %ld/%ld:%ld/%ld %d,%d:%d,%d %lu:%lu (HZ=%d) ", 1087 "onoff: %ld/%ld:%ld/%ld %d,%d:%d,%d %lu:%lu (HZ=%d) ",
1093 n_online_successes, n_online_attempts, 1088 n_online_successes, n_online_attempts,
1094 n_offline_successes, n_offline_attempts, 1089 n_offline_successes, n_offline_attempts,
1095 min_online, max_online, 1090 min_online, max_online,
1096 min_offline, max_offline, 1091 min_offline, max_offline,
1097 sum_online, sum_offline, HZ); 1092 sum_online, sum_offline, HZ);
1098 cnt += sprintf(&page[cnt], "barrier: %ld/%ld:%ld", 1093 page += sprintf(page, "barrier: %ld/%ld:%ld",
1099 n_barrier_successes, 1094 n_barrier_successes,
1100 n_barrier_attempts, 1095 n_barrier_attempts,
1101 n_rcu_torture_barrier_error); 1096 n_rcu_torture_barrier_error);
1102 cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG); 1097 page += sprintf(page, "\n%s%s ", torture_type, TORTURE_FLAG);
1103 if (atomic_read(&n_rcu_torture_mberror) != 0 || 1098 if (atomic_read(&n_rcu_torture_mberror) != 0 ||
1104 n_rcu_torture_barrier_error != 0 || 1099 n_rcu_torture_barrier_error != 0 ||
1105 n_rcu_torture_boost_ktrerror != 0 || 1100 n_rcu_torture_boost_ktrerror != 0 ||
1106 n_rcu_torture_boost_rterror != 0 || 1101 n_rcu_torture_boost_rterror != 0 ||
1107 n_rcu_torture_boost_failure != 0 || 1102 n_rcu_torture_boost_failure != 0 ||
1108 i > 1) { 1103 i > 1) {
1109 cnt += sprintf(&page[cnt], "!!! "); 1104 page += sprintf(page, "!!! ");
1110 atomic_inc(&n_rcu_torture_error); 1105 atomic_inc(&n_rcu_torture_error);
1111 WARN_ON_ONCE(1); 1106 WARN_ON_ONCE(1);
1112 } 1107 }
1113 cnt += sprintf(&page[cnt], "Reader Pipe: "); 1108 page += sprintf(page, "Reader Pipe: ");
1114 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) 1109 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
1115 cnt += sprintf(&page[cnt], " %ld", pipesummary[i]); 1110 page += sprintf(page, " %ld", pipesummary[i]);
1116 cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG); 1111 page += sprintf(page, "\n%s%s ", torture_type, TORTURE_FLAG);
1117 cnt += sprintf(&page[cnt], "Reader Batch: "); 1112 page += sprintf(page, "Reader Batch: ");
1118 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) 1113 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
1119 cnt += sprintf(&page[cnt], " %ld", batchsummary[i]); 1114 page += sprintf(page, " %ld", batchsummary[i]);
1120 cnt += sprintf(&page[cnt], "\n%s%s ", torture_type, TORTURE_FLAG); 1115 page += sprintf(page, "\n%s%s ", torture_type, TORTURE_FLAG);
1121 cnt += sprintf(&page[cnt], "Free-Block Circulation: "); 1116 page += sprintf(page, "Free-Block Circulation: ");
1122 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) { 1117 for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++) {
1123 cnt += sprintf(&page[cnt], " %d", 1118 page += sprintf(page, " %d",
1124 atomic_read(&rcu_torture_wcount[i])); 1119 atomic_read(&rcu_torture_wcount[i]));
1125 } 1120 }
1126 cnt += sprintf(&page[cnt], "\n"); 1121 page += sprintf(page, "\n");
1127 if (cur_ops->stats) 1122 if (cur_ops->stats)
1128 cnt += cur_ops->stats(&page[cnt]); 1123 cur_ops->stats(page);
1129 return cnt;
1130} 1124}
1131 1125
1132/* 1126/*
@@ -1140,10 +1134,17 @@ rcu_torture_printk(char *page)
1140static void 1134static void
1141rcu_torture_stats_print(void) 1135rcu_torture_stats_print(void)
1142{ 1136{
1143 int cnt; 1137 int size = nr_cpu_ids * 200 + 8192;
1138 char *buf;
1144 1139
1145 cnt = rcu_torture_printk(printk_buf); 1140 buf = kmalloc(size, GFP_KERNEL);
1146 pr_alert("%s", printk_buf); 1141 if (!buf) {
1142 pr_err("rcu-torture: Out of memory, need: %d", size);
1143 return;
1144 }
1145 rcu_torture_printk(buf);
1146 pr_alert("%s", buf);
1147 kfree(buf);
1147} 1148}
1148 1149
1149/* 1150/*
@@ -1578,6 +1579,7 @@ static int rcu_torture_barrier_cbs(void *arg)
1578{ 1579{
1579 long myid = (long)arg; 1580 long myid = (long)arg;
1580 bool lastphase = 0; 1581 bool lastphase = 0;
1582 bool newphase;
1581 struct rcu_head rcu; 1583 struct rcu_head rcu;
1582 1584
1583 init_rcu_head_on_stack(&rcu); 1585 init_rcu_head_on_stack(&rcu);
@@ -1585,10 +1587,11 @@ static int rcu_torture_barrier_cbs(void *arg)
1585 set_user_nice(current, 19); 1587 set_user_nice(current, 19);
1586 do { 1588 do {
1587 wait_event(barrier_cbs_wq[myid], 1589 wait_event(barrier_cbs_wq[myid],
1588 barrier_phase != lastphase || 1590 (newphase =
1591 ACCESS_ONCE(barrier_phase)) != lastphase ||
1589 kthread_should_stop() || 1592 kthread_should_stop() ||
1590 fullstop != FULLSTOP_DONTSTOP); 1593 fullstop != FULLSTOP_DONTSTOP);
1591 lastphase = barrier_phase; 1594 lastphase = newphase;
1592 smp_mb(); /* ensure barrier_phase load before ->call(). */ 1595 smp_mb(); /* ensure barrier_phase load before ->call(). */
1593 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP) 1596 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP)
1594 break; 1597 break;
@@ -1625,7 +1628,7 @@ static int rcu_torture_barrier(void *arg)
1625 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP) 1628 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP)
1626 break; 1629 break;
1627 n_barrier_attempts++; 1630 n_barrier_attempts++;
1628 cur_ops->cb_barrier(); 1631 cur_ops->cb_barrier(); /* Implies smp_mb() for wait_event(). */
1629 if (atomic_read(&barrier_cbs_invoked) != n_barrier_cbs) { 1632 if (atomic_read(&barrier_cbs_invoked) != n_barrier_cbs) {
1630 n_rcu_torture_barrier_error++; 1633 n_rcu_torture_barrier_error++;
1631 WARN_ON_ONCE(1); 1634 WARN_ON_ONCE(1);
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index dd081987a8ec..e37bd561c26f 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -369,6 +369,9 @@ static struct rcu_node *rcu_get_root(struct rcu_state *rsp)
369static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval, 369static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval,
370 bool user) 370 bool user)
371{ 371{
372 struct rcu_state *rsp;
373 struct rcu_data *rdp;
374
372 trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting); 375 trace_rcu_dyntick(TPS("Start"), oldval, rdtp->dynticks_nesting);
373 if (!user && !is_idle_task(current)) { 376 if (!user && !is_idle_task(current)) {
374 struct task_struct *idle __maybe_unused = 377 struct task_struct *idle __maybe_unused =
@@ -380,6 +383,10 @@ static void rcu_eqs_enter_common(struct rcu_dynticks *rdtp, long long oldval,
380 current->pid, current->comm, 383 current->pid, current->comm,
381 idle->pid, idle->comm); /* must be idle task! */ 384 idle->pid, idle->comm); /* must be idle task! */
382 } 385 }
386 for_each_rcu_flavor(rsp) {
387 rdp = this_cpu_ptr(rsp->rda);
388 do_nocb_deferred_wakeup(rdp);
389 }
383 rcu_prepare_for_idle(smp_processor_id()); 390 rcu_prepare_for_idle(smp_processor_id());
384 /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */ 391 /* CPUs seeing atomic_inc() must see prior RCU read-side crit sects */
385 smp_mb__before_atomic_inc(); /* See above. */ 392 smp_mb__before_atomic_inc(); /* See above. */
@@ -411,11 +418,12 @@ static void rcu_eqs_enter(bool user)
411 rdtp = this_cpu_ptr(&rcu_dynticks); 418 rdtp = this_cpu_ptr(&rcu_dynticks);
412 oldval = rdtp->dynticks_nesting; 419 oldval = rdtp->dynticks_nesting;
413 WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0); 420 WARN_ON_ONCE((oldval & DYNTICK_TASK_NEST_MASK) == 0);
414 if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) 421 if ((oldval & DYNTICK_TASK_NEST_MASK) == DYNTICK_TASK_NEST_VALUE) {
415 rdtp->dynticks_nesting = 0; 422 rdtp->dynticks_nesting = 0;
416 else 423 rcu_eqs_enter_common(rdtp, oldval, user);
424 } else {
417 rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE; 425 rdtp->dynticks_nesting -= DYNTICK_TASK_NEST_VALUE;
418 rcu_eqs_enter_common(rdtp, oldval, user); 426 }
419} 427}
420 428
421/** 429/**
@@ -533,11 +541,12 @@ static void rcu_eqs_exit(bool user)
533 rdtp = this_cpu_ptr(&rcu_dynticks); 541 rdtp = this_cpu_ptr(&rcu_dynticks);
534 oldval = rdtp->dynticks_nesting; 542 oldval = rdtp->dynticks_nesting;
535 WARN_ON_ONCE(oldval < 0); 543 WARN_ON_ONCE(oldval < 0);
536 if (oldval & DYNTICK_TASK_NEST_MASK) 544 if (oldval & DYNTICK_TASK_NEST_MASK) {
537 rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE; 545 rdtp->dynticks_nesting += DYNTICK_TASK_NEST_VALUE;
538 else 546 } else {
539 rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE; 547 rdtp->dynticks_nesting = DYNTICK_TASK_EXIT_IDLE;
540 rcu_eqs_exit_common(rdtp, oldval, user); 548 rcu_eqs_exit_common(rdtp, oldval, user);
549 }
541} 550}
542 551
543/** 552/**
@@ -716,7 +725,7 @@ bool rcu_lockdep_current_cpu_online(void)
716 bool ret; 725 bool ret;
717 726
718 if (in_nmi()) 727 if (in_nmi())
719 return 1; 728 return true;
720 preempt_disable(); 729 preempt_disable();
721 rdp = this_cpu_ptr(&rcu_sched_data); 730 rdp = this_cpu_ptr(&rcu_sched_data);
722 rnp = rdp->mynode; 731 rnp = rdp->mynode;
@@ -755,6 +764,12 @@ static int dyntick_save_progress_counter(struct rcu_data *rdp,
755} 764}
756 765
757/* 766/*
767 * This function really isn't for public consumption, but RCU is special in
768 * that context switches can allow the state machine to make progress.
769 */
770extern void resched_cpu(int cpu);
771
772/*
758 * Return true if the specified CPU has passed through a quiescent 773 * Return true if the specified CPU has passed through a quiescent
759 * state by virtue of being in or having passed through an dynticks 774 * state by virtue of being in or having passed through an dynticks
760 * idle state since the last call to dyntick_save_progress_counter() 775 * idle state since the last call to dyntick_save_progress_counter()
@@ -812,16 +827,34 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
812 */ 827 */
813 rcu_kick_nohz_cpu(rdp->cpu); 828 rcu_kick_nohz_cpu(rdp->cpu);
814 829
830 /*
831 * Alternatively, the CPU might be running in the kernel
832 * for an extended period of time without a quiescent state.
833 * Attempt to force the CPU through the scheduler to gain the
834 * needed quiescent state, but only if the grace period has gone
835 * on for an uncommonly long time. If there are many stuck CPUs,
836 * we will beat on the first one until it gets unstuck, then move
837 * to the next. Only do this for the primary flavor of RCU.
838 */
839 if (rdp->rsp == rcu_state &&
840 ULONG_CMP_GE(ACCESS_ONCE(jiffies), rdp->rsp->jiffies_resched)) {
841 rdp->rsp->jiffies_resched += 5;
842 resched_cpu(rdp->cpu);
843 }
844
815 return 0; 845 return 0;
816} 846}
817 847
818static void record_gp_stall_check_time(struct rcu_state *rsp) 848static void record_gp_stall_check_time(struct rcu_state *rsp)
819{ 849{
820 unsigned long j = ACCESS_ONCE(jiffies); 850 unsigned long j = ACCESS_ONCE(jiffies);
851 unsigned long j1;
821 852
822 rsp->gp_start = j; 853 rsp->gp_start = j;
823 smp_wmb(); /* Record start time before stall time. */ 854 smp_wmb(); /* Record start time before stall time. */
824 rsp->jiffies_stall = j + rcu_jiffies_till_stall_check(); 855 j1 = rcu_jiffies_till_stall_check();
856 rsp->jiffies_stall = j + j1;
857 rsp->jiffies_resched = j + j1 / 2;
825} 858}
826 859
827/* 860/*
@@ -1509,6 +1542,7 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
1509 rdp = this_cpu_ptr(rsp->rda); 1542 rdp = this_cpu_ptr(rsp->rda);
1510 if (rnp == rdp->mynode) 1543 if (rnp == rdp->mynode)
1511 __note_gp_changes(rsp, rnp, rdp); 1544 __note_gp_changes(rsp, rnp, rdp);
1545 /* smp_mb() provided by prior unlock-lock pair. */
1512 nocb += rcu_future_gp_cleanup(rsp, rnp); 1546 nocb += rcu_future_gp_cleanup(rsp, rnp);
1513 raw_spin_unlock_irq(&rnp->lock); 1547 raw_spin_unlock_irq(&rnp->lock);
1514 cond_resched(); 1548 cond_resched();
@@ -1553,6 +1587,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
1553 wait_event_interruptible(rsp->gp_wq, 1587 wait_event_interruptible(rsp->gp_wq,
1554 ACCESS_ONCE(rsp->gp_flags) & 1588 ACCESS_ONCE(rsp->gp_flags) &
1555 RCU_GP_FLAG_INIT); 1589 RCU_GP_FLAG_INIT);
1590 /* Locking provides needed memory barrier. */
1556 if (rcu_gp_init(rsp)) 1591 if (rcu_gp_init(rsp))
1557 break; 1592 break;
1558 cond_resched(); 1593 cond_resched();
@@ -1582,6 +1617,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
1582 (!ACCESS_ONCE(rnp->qsmask) && 1617 (!ACCESS_ONCE(rnp->qsmask) &&
1583 !rcu_preempt_blocked_readers_cgp(rnp)), 1618 !rcu_preempt_blocked_readers_cgp(rnp)),
1584 j); 1619 j);
1620 /* Locking provides needed memory barriers. */
1585 /* If grace period done, leave loop. */ 1621 /* If grace period done, leave loop. */
1586 if (!ACCESS_ONCE(rnp->qsmask) && 1622 if (!ACCESS_ONCE(rnp->qsmask) &&
1587 !rcu_preempt_blocked_readers_cgp(rnp)) 1623 !rcu_preempt_blocked_readers_cgp(rnp))
@@ -1901,13 +1937,13 @@ rcu_send_cbs_to_orphanage(int cpu, struct rcu_state *rsp,
1901 * Adopt the RCU callbacks from the specified rcu_state structure's 1937 * Adopt the RCU callbacks from the specified rcu_state structure's
1902 * orphanage. The caller must hold the ->orphan_lock. 1938 * orphanage. The caller must hold the ->orphan_lock.
1903 */ 1939 */
1904static void rcu_adopt_orphan_cbs(struct rcu_state *rsp) 1940static void rcu_adopt_orphan_cbs(struct rcu_state *rsp, unsigned long flags)
1905{ 1941{
1906 int i; 1942 int i;
1907 struct rcu_data *rdp = __this_cpu_ptr(rsp->rda); 1943 struct rcu_data *rdp = __this_cpu_ptr(rsp->rda);
1908 1944
1909 /* No-CBs CPUs are handled specially. */ 1945 /* No-CBs CPUs are handled specially. */
1910 if (rcu_nocb_adopt_orphan_cbs(rsp, rdp)) 1946 if (rcu_nocb_adopt_orphan_cbs(rsp, rdp, flags))
1911 return; 1947 return;
1912 1948
1913 /* Do the accounting first. */ 1949 /* Do the accounting first. */
@@ -1986,7 +2022,7 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp)
1986 2022
1987 /* Orphan the dead CPU's callbacks, and adopt them if appropriate. */ 2023 /* Orphan the dead CPU's callbacks, and adopt them if appropriate. */
1988 rcu_send_cbs_to_orphanage(cpu, rsp, rnp, rdp); 2024 rcu_send_cbs_to_orphanage(cpu, rsp, rnp, rdp);
1989 rcu_adopt_orphan_cbs(rsp); 2025 rcu_adopt_orphan_cbs(rsp, flags);
1990 2026
1991 /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */ 2027 /* Remove the outgoing CPU from the masks in the rcu_node hierarchy. */
1992 mask = rdp->grpmask; /* rnp->grplo is constant. */ 2028 mask = rdp->grpmask; /* rnp->grplo is constant. */
@@ -2303,6 +2339,9 @@ __rcu_process_callbacks(struct rcu_state *rsp)
2303 /* If there are callbacks ready, invoke them. */ 2339 /* If there are callbacks ready, invoke them. */
2304 if (cpu_has_callbacks_ready_to_invoke(rdp)) 2340 if (cpu_has_callbacks_ready_to_invoke(rdp))
2305 invoke_rcu_callbacks(rsp, rdp); 2341 invoke_rcu_callbacks(rsp, rdp);
2342
2343 /* Do any needed deferred wakeups of rcuo kthreads. */
2344 do_nocb_deferred_wakeup(rdp);
2306} 2345}
2307 2346
2308/* 2347/*
@@ -2437,7 +2476,7 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu),
2437 2476
2438 if (cpu != -1) 2477 if (cpu != -1)
2439 rdp = per_cpu_ptr(rsp->rda, cpu); 2478 rdp = per_cpu_ptr(rsp->rda, cpu);
2440 offline = !__call_rcu_nocb(rdp, head, lazy); 2479 offline = !__call_rcu_nocb(rdp, head, lazy, flags);
2441 WARN_ON_ONCE(offline); 2480 WARN_ON_ONCE(offline);
2442 /* _call_rcu() is illegal on offline CPU; leak the callback. */ 2481 /* _call_rcu() is illegal on offline CPU; leak the callback. */
2443 local_irq_restore(flags); 2482 local_irq_restore(flags);
@@ -2757,6 +2796,10 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
2757 /* Check for CPU stalls, if enabled. */ 2796 /* Check for CPU stalls, if enabled. */
2758 check_cpu_stall(rsp, rdp); 2797 check_cpu_stall(rsp, rdp);
2759 2798
2799 /* Is this CPU a NO_HZ_FULL CPU that should ignore RCU? */
2800 if (rcu_nohz_full_cpu(rsp))
2801 return 0;
2802
2760 /* Is the RCU core waiting for a quiescent state from this CPU? */ 2803 /* Is the RCU core waiting for a quiescent state from this CPU? */
2761 if (rcu_scheduler_fully_active && 2804 if (rcu_scheduler_fully_active &&
2762 rdp->qs_pending && !rdp->passed_quiesce) { 2805 rdp->qs_pending && !rdp->passed_quiesce) {
@@ -2790,6 +2833,12 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
2790 return 1; 2833 return 1;
2791 } 2834 }
2792 2835
2836 /* Does this CPU need a deferred NOCB wakeup? */
2837 if (rcu_nocb_need_deferred_wakeup(rdp)) {
2838 rdp->n_rp_nocb_defer_wakeup++;
2839 return 1;
2840 }
2841
2793 /* nothing to do */ 2842 /* nothing to do */
2794 rdp->n_rp_need_nothing++; 2843 rdp->n_rp_need_nothing++;
2795 return 0; 2844 return 0;
@@ -3214,9 +3263,9 @@ static void __init rcu_init_levelspread(struct rcu_state *rsp)
3214{ 3263{
3215 int i; 3264 int i;
3216 3265
3217 for (i = rcu_num_lvls - 1; i > 0; i--) 3266 rsp->levelspread[rcu_num_lvls - 1] = rcu_fanout_leaf;
3267 for (i = rcu_num_lvls - 2; i >= 0; i--)
3218 rsp->levelspread[i] = CONFIG_RCU_FANOUT; 3268 rsp->levelspread[i] = CONFIG_RCU_FANOUT;
3219 rsp->levelspread[0] = rcu_fanout_leaf;
3220} 3269}
3221#else /* #ifdef CONFIG_RCU_FANOUT_EXACT */ 3270#else /* #ifdef CONFIG_RCU_FANOUT_EXACT */
3222static void __init rcu_init_levelspread(struct rcu_state *rsp) 3271static void __init rcu_init_levelspread(struct rcu_state *rsp)
@@ -3346,6 +3395,8 @@ static void __init rcu_init_geometry(void)
3346 if (rcu_fanout_leaf == CONFIG_RCU_FANOUT_LEAF && 3395 if (rcu_fanout_leaf == CONFIG_RCU_FANOUT_LEAF &&
3347 nr_cpu_ids == NR_CPUS) 3396 nr_cpu_ids == NR_CPUS)
3348 return; 3397 return;
3398 pr_info("RCU: Adjusting geometry for rcu_fanout_leaf=%d, nr_cpu_ids=%d\n",
3399 rcu_fanout_leaf, nr_cpu_ids);
3349 3400
3350 /* 3401 /*
3351 * Compute number of nodes that can be handled an rcu_node tree 3402 * Compute number of nodes that can be handled an rcu_node tree
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 52be957c9fe2..8c19873f1ac9 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -317,6 +317,7 @@ struct rcu_data {
317 unsigned long n_rp_cpu_needs_gp; 317 unsigned long n_rp_cpu_needs_gp;
318 unsigned long n_rp_gp_completed; 318 unsigned long n_rp_gp_completed;
319 unsigned long n_rp_gp_started; 319 unsigned long n_rp_gp_started;
320 unsigned long n_rp_nocb_defer_wakeup;
320 unsigned long n_rp_need_nothing; 321 unsigned long n_rp_need_nothing;
321 322
322 /* 6) _rcu_barrier() and OOM callbacks. */ 323 /* 6) _rcu_barrier() and OOM callbacks. */
@@ -335,6 +336,7 @@ struct rcu_data {
335 int nocb_p_count_lazy; /* (approximate). */ 336 int nocb_p_count_lazy; /* (approximate). */
336 wait_queue_head_t nocb_wq; /* For nocb kthreads to sleep on. */ 337 wait_queue_head_t nocb_wq; /* For nocb kthreads to sleep on. */
337 struct task_struct *nocb_kthread; 338 struct task_struct *nocb_kthread;
339 bool nocb_defer_wakeup; /* Defer wakeup of nocb_kthread. */
338#endif /* #ifdef CONFIG_RCU_NOCB_CPU */ 340#endif /* #ifdef CONFIG_RCU_NOCB_CPU */
339 341
340 /* 8) RCU CPU stall data. */ 342 /* 8) RCU CPU stall data. */
@@ -453,6 +455,8 @@ struct rcu_state {
453 /* but in jiffies. */ 455 /* but in jiffies. */
454 unsigned long jiffies_stall; /* Time at which to check */ 456 unsigned long jiffies_stall; /* Time at which to check */
455 /* for CPU stalls. */ 457 /* for CPU stalls. */
458 unsigned long jiffies_resched; /* Time at which to resched */
459 /* a reluctant CPU. */
456 unsigned long gp_max; /* Maximum GP duration in */ 460 unsigned long gp_max; /* Maximum GP duration in */
457 /* jiffies. */ 461 /* jiffies. */
458 const char *name; /* Name of structure. */ 462 const char *name; /* Name of structure. */
@@ -548,9 +552,12 @@ static void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq);
548static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp); 552static void rcu_nocb_gp_cleanup(struct rcu_state *rsp, struct rcu_node *rnp);
549static void rcu_init_one_nocb(struct rcu_node *rnp); 553static void rcu_init_one_nocb(struct rcu_node *rnp);
550static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, 554static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,
551 bool lazy); 555 bool lazy, unsigned long flags);
552static bool rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp, 556static bool rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,
553 struct rcu_data *rdp); 557 struct rcu_data *rdp,
558 unsigned long flags);
559static bool rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp);
560static void do_nocb_deferred_wakeup(struct rcu_data *rdp);
554static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp); 561static void rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp);
555static void rcu_spawn_nocb_kthreads(struct rcu_state *rsp); 562static void rcu_spawn_nocb_kthreads(struct rcu_state *rsp);
556static void rcu_kick_nohz_cpu(int cpu); 563static void rcu_kick_nohz_cpu(int cpu);
@@ -564,6 +571,7 @@ static void rcu_sysidle_report_gp(struct rcu_state *rsp, int isidle,
564 unsigned long maxj); 571 unsigned long maxj);
565static void rcu_bind_gp_kthread(void); 572static void rcu_bind_gp_kthread(void);
566static void rcu_sysidle_init_percpu_data(struct rcu_dynticks *rdtp); 573static void rcu_sysidle_init_percpu_data(struct rcu_dynticks *rdtp);
574static bool rcu_nohz_full_cpu(struct rcu_state *rsp);
567 575
568#endif /* #ifndef RCU_TREE_NONCORE */ 576#endif /* #ifndef RCU_TREE_NONCORE */
569 577
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 08a765232432..3ca32736e264 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -361,10 +361,14 @@ void rcu_read_unlock_special(struct task_struct *t)
361 special = t->rcu_read_unlock_special; 361 special = t->rcu_read_unlock_special;
362 if (special & RCU_READ_UNLOCK_NEED_QS) { 362 if (special & RCU_READ_UNLOCK_NEED_QS) {
363 rcu_preempt_qs(smp_processor_id()); 363 rcu_preempt_qs(smp_processor_id());
364 if (!t->rcu_read_unlock_special) {
365 local_irq_restore(flags);
366 return;
367 }
364 } 368 }
365 369
366 /* Hardware IRQ handlers cannot block. */ 370 /* Hardware IRQ handlers cannot block, complain if they get here. */
367 if (in_irq() || in_serving_softirq()) { 371 if (WARN_ON_ONCE(in_irq() || in_serving_softirq())) {
368 local_irq_restore(flags); 372 local_irq_restore(flags);
369 return; 373 return;
370 } 374 }
@@ -779,8 +783,10 @@ static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
779 } 783 }
780 if (rnp->parent == NULL) { 784 if (rnp->parent == NULL) {
781 raw_spin_unlock_irqrestore(&rnp->lock, flags); 785 raw_spin_unlock_irqrestore(&rnp->lock, flags);
782 if (wake) 786 if (wake) {
787 smp_mb(); /* EGP done before wake_up(). */
783 wake_up(&sync_rcu_preempt_exp_wq); 788 wake_up(&sync_rcu_preempt_exp_wq);
789 }
784 break; 790 break;
785 } 791 }
786 mask = rnp->grpmask; 792 mask = rnp->grpmask;
@@ -1852,6 +1858,7 @@ static int rcu_oom_notify(struct notifier_block *self,
1852 1858
1853 /* Wait for callbacks from earlier instance to complete. */ 1859 /* Wait for callbacks from earlier instance to complete. */
1854 wait_event(oom_callback_wq, atomic_read(&oom_callback_count) == 0); 1860 wait_event(oom_callback_wq, atomic_read(&oom_callback_count) == 0);
1861 smp_mb(); /* Ensure callback reuse happens after callback invocation. */
1855 1862
1856 /* 1863 /*
1857 * Prevent premature wakeup: ensure that all increments happen 1864 * Prevent premature wakeup: ensure that all increments happen
@@ -2101,7 +2108,8 @@ bool rcu_is_nocb_cpu(int cpu)
2101static void __call_rcu_nocb_enqueue(struct rcu_data *rdp, 2108static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
2102 struct rcu_head *rhp, 2109 struct rcu_head *rhp,
2103 struct rcu_head **rhtp, 2110 struct rcu_head **rhtp,
2104 int rhcount, int rhcount_lazy) 2111 int rhcount, int rhcount_lazy,
2112 unsigned long flags)
2105{ 2113{
2106 int len; 2114 int len;
2107 struct rcu_head **old_rhpp; 2115 struct rcu_head **old_rhpp;
@@ -2122,9 +2130,16 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
2122 } 2130 }
2123 len = atomic_long_read(&rdp->nocb_q_count); 2131 len = atomic_long_read(&rdp->nocb_q_count);
2124 if (old_rhpp == &rdp->nocb_head) { 2132 if (old_rhpp == &rdp->nocb_head) {
2125 wake_up(&rdp->nocb_wq); /* ... only if queue was empty ... */ 2133 if (!irqs_disabled_flags(flags)) {
2134 wake_up(&rdp->nocb_wq); /* ... if queue was empty ... */
2135 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu,
2136 TPS("WakeEmpty"));
2137 } else {
2138 rdp->nocb_defer_wakeup = true;
2139 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu,
2140 TPS("WakeEmptyIsDeferred"));
2141 }
2126 rdp->qlen_last_fqs_check = 0; 2142 rdp->qlen_last_fqs_check = 0;
2127 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, TPS("WakeEmpty"));
2128 } else if (len > rdp->qlen_last_fqs_check + qhimark) { 2143 } else if (len > rdp->qlen_last_fqs_check + qhimark) {
2129 wake_up_process(t); /* ... or if many callbacks queued. */ 2144 wake_up_process(t); /* ... or if many callbacks queued. */
2130 rdp->qlen_last_fqs_check = LONG_MAX / 2; 2145 rdp->qlen_last_fqs_check = LONG_MAX / 2;
@@ -2145,12 +2160,12 @@ static void __call_rcu_nocb_enqueue(struct rcu_data *rdp,
2145 * "rcuo" kthread can find it. 2160 * "rcuo" kthread can find it.
2146 */ 2161 */
2147static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, 2162static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,
2148 bool lazy) 2163 bool lazy, unsigned long flags)
2149{ 2164{
2150 2165
2151 if (!rcu_is_nocb_cpu(rdp->cpu)) 2166 if (!rcu_is_nocb_cpu(rdp->cpu))
2152 return 0; 2167 return 0;
2153 __call_rcu_nocb_enqueue(rdp, rhp, &rhp->next, 1, lazy); 2168 __call_rcu_nocb_enqueue(rdp, rhp, &rhp->next, 1, lazy, flags);
2154 if (__is_kfree_rcu_offset((unsigned long)rhp->func)) 2169 if (__is_kfree_rcu_offset((unsigned long)rhp->func))
2155 trace_rcu_kfree_callback(rdp->rsp->name, rhp, 2170 trace_rcu_kfree_callback(rdp->rsp->name, rhp,
2156 (unsigned long)rhp->func, 2171 (unsigned long)rhp->func,
@@ -2168,7 +2183,8 @@ static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,
2168 * not a no-CBs CPU. 2183 * not a no-CBs CPU.
2169 */ 2184 */
2170static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp, 2185static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,
2171 struct rcu_data *rdp) 2186 struct rcu_data *rdp,
2187 unsigned long flags)
2172{ 2188{
2173 long ql = rsp->qlen; 2189 long ql = rsp->qlen;
2174 long qll = rsp->qlen_lazy; 2190 long qll = rsp->qlen_lazy;
@@ -2182,14 +2198,14 @@ static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,
2182 /* First, enqueue the donelist, if any. This preserves CB ordering. */ 2198 /* First, enqueue the donelist, if any. This preserves CB ordering. */
2183 if (rsp->orphan_donelist != NULL) { 2199 if (rsp->orphan_donelist != NULL) {
2184 __call_rcu_nocb_enqueue(rdp, rsp->orphan_donelist, 2200 __call_rcu_nocb_enqueue(rdp, rsp->orphan_donelist,
2185 rsp->orphan_donetail, ql, qll); 2201 rsp->orphan_donetail, ql, qll, flags);
2186 ql = qll = 0; 2202 ql = qll = 0;
2187 rsp->orphan_donelist = NULL; 2203 rsp->orphan_donelist = NULL;
2188 rsp->orphan_donetail = &rsp->orphan_donelist; 2204 rsp->orphan_donetail = &rsp->orphan_donelist;
2189 } 2205 }
2190 if (rsp->orphan_nxtlist != NULL) { 2206 if (rsp->orphan_nxtlist != NULL) {
2191 __call_rcu_nocb_enqueue(rdp, rsp->orphan_nxtlist, 2207 __call_rcu_nocb_enqueue(rdp, rsp->orphan_nxtlist,
2192 rsp->orphan_nxttail, ql, qll); 2208 rsp->orphan_nxttail, ql, qll, flags);
2193 ql = qll = 0; 2209 ql = qll = 0;
2194 rsp->orphan_nxtlist = NULL; 2210 rsp->orphan_nxtlist = NULL;
2195 rsp->orphan_nxttail = &rsp->orphan_nxtlist; 2211 rsp->orphan_nxttail = &rsp->orphan_nxtlist;
@@ -2250,6 +2266,7 @@ static int rcu_nocb_kthread(void *arg)
2250 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, 2266 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu,
2251 TPS("Sleep")); 2267 TPS("Sleep"));
2252 wait_event_interruptible(rdp->nocb_wq, rdp->nocb_head); 2268 wait_event_interruptible(rdp->nocb_wq, rdp->nocb_head);
2269 /* Memory barrier provide by xchg() below. */
2253 } else if (firsttime) { 2270 } else if (firsttime) {
2254 firsttime = 0; 2271 firsttime = 0;
2255 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, 2272 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu,
@@ -2310,6 +2327,22 @@ static int rcu_nocb_kthread(void *arg)
2310 return 0; 2327 return 0;
2311} 2328}
2312 2329
2330/* Is a deferred wakeup of rcu_nocb_kthread() required? */
2331static bool rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp)
2332{
2333 return ACCESS_ONCE(rdp->nocb_defer_wakeup);
2334}
2335
2336/* Do a deferred wakeup of rcu_nocb_kthread(). */
2337static void do_nocb_deferred_wakeup(struct rcu_data *rdp)
2338{
2339 if (!rcu_nocb_need_deferred_wakeup(rdp))
2340 return;
2341 ACCESS_ONCE(rdp->nocb_defer_wakeup) = false;
2342 wake_up(&rdp->nocb_wq);
2343 trace_rcu_nocb_wake(rdp->rsp->name, rdp->cpu, TPS("DeferredWakeEmpty"));
2344}
2345
2313/* Initialize per-rcu_data variables for no-CBs CPUs. */ 2346/* Initialize per-rcu_data variables for no-CBs CPUs. */
2314static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp) 2347static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp)
2315{ 2348{
@@ -2365,13 +2398,14 @@ static void rcu_init_one_nocb(struct rcu_node *rnp)
2365} 2398}
2366 2399
2367static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp, 2400static bool __call_rcu_nocb(struct rcu_data *rdp, struct rcu_head *rhp,
2368 bool lazy) 2401 bool lazy, unsigned long flags)
2369{ 2402{
2370 return 0; 2403 return 0;
2371} 2404}
2372 2405
2373static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp, 2406static bool __maybe_unused rcu_nocb_adopt_orphan_cbs(struct rcu_state *rsp,
2374 struct rcu_data *rdp) 2407 struct rcu_data *rdp,
2408 unsigned long flags)
2375{ 2409{
2376 return 0; 2410 return 0;
2377} 2411}
@@ -2380,6 +2414,15 @@ static void __init rcu_boot_init_nocb_percpu_data(struct rcu_data *rdp)
2380{ 2414{
2381} 2415}
2382 2416
2417static bool rcu_nocb_need_deferred_wakeup(struct rcu_data *rdp)
2418{
2419 return false;
2420}
2421
2422static void do_nocb_deferred_wakeup(struct rcu_data *rdp)
2423{
2424}
2425
2383static void __init rcu_spawn_nocb_kthreads(struct rcu_state *rsp) 2426static void __init rcu_spawn_nocb_kthreads(struct rcu_state *rsp)
2384{ 2427{
2385} 2428}
@@ -2829,3 +2872,23 @@ static void rcu_sysidle_init_percpu_data(struct rcu_dynticks *rdtp)
2829} 2872}
2830 2873
2831#endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */ 2874#endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
2875
2876/*
2877 * Is this CPU a NO_HZ_FULL CPU that should ignore RCU so that the
2878 * grace-period kthread will do force_quiescent_state() processing?
2879 * The idea is to avoid waking up RCU core processing on such a
2880 * CPU unless the grace period has extended for too long.
2881 *
2882 * This code relies on the fact that all NO_HZ_FULL CPUs are also
2883 * CONFIG_RCU_NOCB_CPUs.
2884 */
2885static bool rcu_nohz_full_cpu(struct rcu_state *rsp)
2886{
2887#ifdef CONFIG_NO_HZ_FULL
2888 if (tick_nohz_full_cpu(smp_processor_id()) &&
2889 (!rcu_gp_in_progress(rsp) ||
2890 ULONG_CMP_LT(jiffies, ACCESS_ONCE(rsp->gp_start) + HZ)))
2891 return 1;
2892#endif /* #ifdef CONFIG_NO_HZ_FULL */
2893 return 0;
2894}
diff --git a/kernel/rcu/tree_trace.c b/kernel/rcu/tree_trace.c
index 3596797b7e46..4def475336d4 100644
--- a/kernel/rcu/tree_trace.c
+++ b/kernel/rcu/tree_trace.c
@@ -364,9 +364,10 @@ static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp)
364 rdp->n_rp_report_qs, 364 rdp->n_rp_report_qs,
365 rdp->n_rp_cb_ready, 365 rdp->n_rp_cb_ready,
366 rdp->n_rp_cpu_needs_gp); 366 rdp->n_rp_cpu_needs_gp);
367 seq_printf(m, "gpc=%ld gps=%ld nn=%ld\n", 367 seq_printf(m, "gpc=%ld gps=%ld nn=%ld ndw%ld\n",
368 rdp->n_rp_gp_completed, 368 rdp->n_rp_gp_completed,
369 rdp->n_rp_gp_started, 369 rdp->n_rp_gp_started,
370 rdp->n_rp_nocb_defer_wakeup,
370 rdp->n_rp_need_nothing); 371 rdp->n_rp_need_nothing);
371} 372}
372 373
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 6cb3dff89e2b..802365ccd591 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -128,6 +128,11 @@ struct lockdep_map rcu_sched_lock_map =
128 STATIC_LOCKDEP_MAP_INIT("rcu_read_lock_sched", &rcu_sched_lock_key); 128 STATIC_LOCKDEP_MAP_INIT("rcu_read_lock_sched", &rcu_sched_lock_key);
129EXPORT_SYMBOL_GPL(rcu_sched_lock_map); 129EXPORT_SYMBOL_GPL(rcu_sched_lock_map);
130 130
131static struct lock_class_key rcu_callback_key;
132struct lockdep_map rcu_callback_map =
133 STATIC_LOCKDEP_MAP_INIT("rcu_callback", &rcu_callback_key);
134EXPORT_SYMBOL_GPL(rcu_callback_map);
135
131int notrace debug_lockdep_rcu_enabled(void) 136int notrace debug_lockdep_rcu_enabled(void)
132{ 137{
133 return rcu_scheduler_active && debug_locks && 138 return rcu_scheduler_active && debug_locks &&
diff --git a/tools/testing/selftests/rcutorture/.gitignore b/tools/testing/selftests/rcutorture/.gitignore
new file mode 100644
index 000000000000..05838f6f2ebe
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/.gitignore
@@ -0,0 +1,6 @@
1initrd
2linux-2.6
3b[0-9]*
4rcu-test-image
5res
6*.swp
diff --git a/tools/testing/selftests/rcutorture/bin/config2frag.sh b/tools/testing/selftests/rcutorture/bin/config2frag.sh
new file mode 100644
index 000000000000..9f9ffcd427d3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/config2frag.sh
@@ -0,0 +1,25 @@
1#!/bin/sh
2# Usage: sh config2frag.sh < .config > configfrag
3#
4# Converts the "# CONFIG_XXX is not set" to "CONFIG_XXX=n" so that the
5# resulting file becomes a legitimate Kconfig fragment.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2013
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25LANG=C sed -e 's/^# CONFIG_\([a-zA-Z0-9_]*\) is not set$/CONFIG_\1=n/'
diff --git a/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh
new file mode 100755
index 000000000000..43540f1828cc
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/configNR_CPUS.sh
@@ -0,0 +1,45 @@
1#!/bin/bash
2#
3# Extract the number of CPUs expected from the specified Kconfig-file
4# fragment by checking CONFIG_SMP and CONFIG_NR_CPUS. If the specified
5# file gives no clue, base the number on the number of idle CPUs on
6# the system.
7#
8# Usage: configNR_CPUS.sh config-frag
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, you can access it online at
22# http://www.gnu.org/licenses/gpl-2.0.html.
23#
24# Copyright (C) IBM Corporation, 2013
25#
26# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
27
28cf=$1
29if test ! -r $cf
30then
31 echo Unreadable config fragment $cf 1>&2
32 exit -1
33fi
34if grep -q '^CONFIG_SMP=n$' $cf
35then
36 echo 1
37 exit 0
38fi
39if grep -q '^CONFIG_NR_CPUS=' $cf
40then
41 grep '^CONFIG_NR_CPUS=' $cf |
42 sed -e 's/^CONFIG_NR_CPUS=\([0-9]*\).*$/\1/'
43 exit 0
44fi
45cpus2use.sh
diff --git a/tools/testing/selftests/rcutorture/bin/configcheck.sh b/tools/testing/selftests/rcutorture/bin/configcheck.sh
new file mode 100755
index 000000000000..d686537dd55c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/configcheck.sh
@@ -0,0 +1,54 @@
1#!/bin/sh
2# Usage: sh configcheck.sh .config .config-template
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, you can access it online at
16# http://www.gnu.org/licenses/gpl-2.0.html.
17#
18# Copyright (C) IBM Corporation, 2011
19#
20# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
21
22T=/tmp/abat-chk-config.sh.$$
23trap 'rm -rf $T' 0
24mkdir $T
25
26cat $1 > $T/.config
27
28cat $2 | sed -e 's/\(.*\)=n/# \1 is not set/' -e 's/^#CHECK#//' |
29awk '
30BEGIN {
31 print "if grep -q \"" $0 "\" < '"$T/.config"'";
32 print "then";
33 print "\t:";
34 print "else";
35 if ($1 == "#") {
36 print "\tif grep -q \"" $2 "\" < '"$T/.config"'";
37 print "\tthen";
38 print "\t\tif test \"$firsttime\" = \"\""
39 print "\t\tthen"
40 print "\t\t\tfirsttime=1"
41 print "\t\tfi"
42 print "\t\techo \":" $2 ": improperly set\"";
43 print "\telse";
44 print "\t\t:";
45 print "\tfi";
46 } else {
47 print "\tif test \"$firsttime\" = \"\""
48 print "\tthen"
49 print "\t\tfirsttime=1"
50 print "\tfi"
51 print "\techo \":" $0 ": improperly set\"";
52 }
53 print "fi";
54 }' | sh
diff --git a/tools/testing/selftests/rcutorture/bin/configinit.sh b/tools/testing/selftests/rcutorture/bin/configinit.sh
new file mode 100755
index 000000000000..a1be6e62add1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/configinit.sh
@@ -0,0 +1,74 @@
1#!/bin/sh
2#
3# sh configinit.sh config-spec-file [ build output dir ]
4#
5# Create a .config file from the spec file. Run from the kernel source tree.
6# Exits with 0 if all went well, with 1 if all went well but the config
7# did not match, and some other number for other failures.
8#
9# The first argument is the .config specification file, which contains
10# desired settings, for example, "CONFIG_NO_HZ=y". For best results,
11# this should be a full pathname.
12#
13# The second argument is a optional path to a build output directory,
14# for example, "O=/tmp/foo". If this argument is omitted, the .config
15# file will be generated directly in the current directory.
16#
17# This program is free software; you can redistribute it and/or modify
18# it under the terms of the GNU General Public License as published by
19# the Free Software Foundation; either version 2 of the License, or
20# (at your option) any later version.
21#
22# This program is distributed in the hope that it will be useful,
23# but WITHOUT ANY WARRANTY; without even the implied warranty of
24# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25# GNU General Public License for more details.
26#
27# You should have received a copy of the GNU General Public License
28# along with this program; if not, you can access it online at
29# http://www.gnu.org/licenses/gpl-2.0.html.
30#
31# Copyright (C) IBM Corporation, 2013
32#
33# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
34
35T=/tmp/configinit.sh.$$
36trap 'rm -rf $T' 0
37mkdir $T
38
39# Capture config spec file.
40
41c=$1
42buildloc=$2
43builddir=
44if test -n $buildloc
45then
46 if echo $buildloc | grep -q '^O='
47 then
48 builddir=`echo $buildloc | sed -e 's/^O=//'`
49 if test ! -d $builddir
50 then
51 mkdir $builddir
52 fi
53 else
54 echo Bad build directory: \"$builddir\"
55 exit 2
56 fi
57fi
58
59sed -e 's/^\(CONFIG[0-9A-Z_]*\)=.*$/grep -v "^# \1" |/' < $c > $T/u.sh
60sed -e 's/^\(CONFIG[0-9A-Z_]*=\).*$/grep -v \1 |/' < $c >> $T/u.sh
61grep '^grep' < $T/u.sh > $T/upd.sh
62echo "cat - $c" >> $T/upd.sh
63make mrproper
64make $buildloc distclean > $builddir/Make.distclean 2>&1
65make $buildloc defconfig > $builddir/Make.defconfig.out 2>&1
66mv $builddir/.config $builddir/.config.sav
67sh $T/upd.sh < $builddir/.config.sav > $builddir/.config
68cp $builddir/.config $builddir/.config.new
69yes '' | make $buildloc oldconfig > $builddir/Make.modconfig.out 2>&1
70
71# verify new config matches specification.
72configcheck.sh $builddir/.config $c
73
74exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/cpus2use.sh b/tools/testing/selftests/rcutorture/bin/cpus2use.sh
new file mode 100755
index 000000000000..abe14b7f36e9
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/cpus2use.sh
@@ -0,0 +1,41 @@
1#!/bin/bash
2#
3# Get an estimate of how CPU-hoggy to be.
4#
5# Usage: cpus2use.sh
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2013
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25ncpus=`grep '^processor' /proc/cpuinfo | wc -l`
26idlecpus=`mpstat | tail -1 | \
27 awk -v ncpus=$ncpus '{ print ncpus * ($7 + $12) / 100 }'`
28awk -v ncpus=$ncpus -v idlecpus=$idlecpus < /dev/null '
29BEGIN {
30 cpus2use = idlecpus;
31 if (cpus2use < 1)
32 cpus2use = 1;
33 if (cpus2use < ncpus / 10)
34 cpus2use = ncpus / 10;
35 if (cpus2use == int(cpus2use))
36 cpus2use = int(cpus2use)
37 else
38 cpus2use = int(cpus2use) + 1
39 print cpus2use;
40}'
41
diff --git a/tools/testing/selftests/rcutorture/bin/functions.sh b/tools/testing/selftests/rcutorture/bin/functions.sh
new file mode 100644
index 000000000000..587561d7c035
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/functions.sh
@@ -0,0 +1,198 @@
1#!/bin/bash
2#
3# Shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# bootparam_hotplug_cpu bootparam-string
24#
25# Returns 1 if the specified boot-parameter string tells rcutorture to
26# test CPU-hotplug operations.
27bootparam_hotplug_cpu () {
28 echo "$1" | grep -q "rcutorture\.onoff_"
29}
30
31# checkarg --argname argtype $# arg mustmatch cannotmatch
32#
33# Checks the specified argument "arg" against the mustmatch and cannotmatch
34# patterns.
35checkarg () {
36 if test $3 -le 1
37 then
38 echo $1 needs argument $2 matching \"$5\"
39 usage
40 fi
41 if echo "$4" | grep -q -e "$5"
42 then
43 :
44 else
45 echo $1 $2 \"$4\" must match \"$5\"
46 usage
47 fi
48 if echo "$4" | grep -q -e "$6"
49 then
50 echo $1 $2 \"$4\" must not match \"$6\"
51 usage
52 fi
53}
54
55# configfrag_boot_params bootparam-string config-fragment-file
56#
57# Adds boot parameters from the .boot file, if any.
58configfrag_boot_params () {
59 if test -r "$2.boot"
60 then
61 echo $1 `grep -v '^#' "$2.boot" | tr '\012' ' '`
62 else
63 echo $1
64 fi
65}
66
67# configfrag_hotplug_cpu config-fragment-file
68#
69# Returns 1 if the config fragment specifies hotplug CPU.
70configfrag_hotplug_cpu () {
71 if test ! -r "$1"
72 then
73 echo Unreadable config fragment "$1" 1>&2
74 exit -1
75 fi
76 grep -q '^CONFIG_HOTPLUG_CPU=y$' "$1"
77}
78
79# identify_qemu builddir
80#
81# Returns our best guess as to which qemu command is appropriate for
82# the kernel at hand. Override with the RCU_QEMU_CMD environment variable.
83identify_qemu () {
84 local u="`file "$1"`"
85 if test -n "$RCU_QEMU_CMD"
86 then
87 echo $RCU_QEMU_CMD
88 elif echo $u | grep -q x86-64
89 then
90 echo qemu-system-x86_64
91 elif echo $u | grep -q "Intel 80386"
92 then
93 echo qemu-system-i386
94 elif uname -a | grep -q ppc64
95 then
96 echo qemu-system-ppc64
97 else
98 echo Cannot figure out what qemu command to use! 1>&2
99 # Usually this will be one of /usr/bin/qemu-system-*
100 # Use RCU_QEMU_CMD environment variable or appropriate
101 # argument to top-level script.
102 exit 1
103 fi
104}
105
106# identify_qemu_append qemu-cmd
107#
108# Output arguments for the qemu "-append" string based on CPU type
109# and the RCU_QEMU_INTERACTIVE environment variable.
110identify_qemu_append () {
111 case "$1" in
112 qemu-system-x86_64|qemu-system-i386)
113 echo noapic selinux=0 initcall_debug debug
114 ;;
115 esac
116 if test -n "$RCU_QEMU_INTERACTIVE"
117 then
118 echo root=/dev/sda
119 else
120 echo console=ttyS0
121 fi
122}
123
124# identify_qemu_args qemu-cmd serial-file
125#
126# Output arguments for qemu arguments based on the RCU_QEMU_MAC
127# and RCU_QEMU_INTERACTIVE environment variables.
128identify_qemu_args () {
129 case "$1" in
130 qemu-system-x86_64|qemu-system-i386)
131 ;;
132 qemu-system-ppc64)
133 echo -enable-kvm -M pseries -cpu POWER7 -nodefaults
134 echo -device spapr-vscsi
135 if test -n "$RCU_QEMU_INTERACTIVE" -a -n "$RCU_QEMU_MAC"
136 then
137 echo -device spapr-vlan,netdev=net0,mac=$RCU_QEMU_MAC
138 echo -netdev bridge,br=br0,id=net0
139 elif test -n "$RCU_QEMU_INTERACTIVE"
140 then
141 echo -net nic -net user
142 fi
143 ;;
144 esac
145 if test -n "$RCU_QEMU_INTERACTIVE"
146 then
147 echo -monitor stdio -serial pty -S
148 else
149 echo -serial file:$2
150 fi
151}
152
153# identify_qemu_vcpus
154#
155# Returns the number of virtual CPUs available to the aggregate of the
156# guest OSes.
157identify_qemu_vcpus () {
158 lscpu | grep '^CPU(s):' | sed -e 's/CPU(s)://'
159}
160
161# print_bug
162#
163# Prints "BUG: " in red followed by remaining arguments
164print_bug () {
165 printf '\033[031mBUG: \033[m'
166 echo $*
167}
168
169# print_warning
170#
171# Prints "WARNING: " in yellow followed by remaining arguments
172print_warning () {
173 printf '\033[033mWARNING: \033[m'
174 echo $*
175}
176
177# specify_qemu_cpus qemu-cmd qemu-args #cpus
178#
179# Appends a string containing "-smp XXX" to qemu-args, unless the incoming
180# qemu-args already contains "-smp".
181specify_qemu_cpus () {
182 local nt;
183
184 if echo $2 | grep -q -e -smp
185 then
186 echo $2
187 else
188 case "$1" in
189 qemu-system-x86_64|qemu-system-i386)
190 echo $2 -smp $3
191 ;;
192 qemu-system-ppc64)
193 nt="`lscpu | grep '^NUMA node0' | sed -e 's/^[^,]*,\([0-9]*\),.*$/\1/'`"
194 echo $2 -smp cores=`expr \( $3 + $nt - 1 \) / $nt`,threads=$nt
195 ;;
196 esac
197 fi
198}
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
new file mode 100755
index 000000000000..197901ec10bf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -0,0 +1,71 @@
1#!/bin/bash
2#
3# Build a kvm-ready Linux kernel from the tree in the current directory.
4#
5# Usage: sh kvm-build.sh config-template build-dir more-configs
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, you can access it online at
19# http://www.gnu.org/licenses/gpl-2.0.html.
20#
21# Copyright (C) IBM Corporation, 2011
22#
23# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
24
25config_template=${1}
26if test -z "$config_template" -o ! -f "$config_template" -o ! -r "$config_template"
27then
28 echo "kvm-build.sh :$config_template: Not a readable file"
29 exit 1
30fi
31builddir=${2}
32if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir"
33then
34 echo "kvm-build.sh :$builddir: Not a writable directory, cannot build into it"
35 exit 1
36fi
37moreconfigs=${3}
38if test -z "$moreconfigs" -o ! -r "$moreconfigs"
39then
40 echo "kvm-build.sh :$moreconfigs: Not a readable file"
41 exit 1
42fi
43
44T=/tmp/test-linux.sh.$$
45trap 'rm -rf $T' 0
46mkdir $T
47
48cat ${config_template} | grep -v CONFIG_RCU_TORTURE_TEST > $T/config
49cat << ___EOF___ >> $T/config
50CONFIG_INITRAMFS_SOURCE="$RCU_INITRD"
51CONFIG_VIRTIO_PCI=y
52CONFIG_VIRTIO_CONSOLE=y
53___EOF___
54cat $moreconfigs >> $T/config
55
56configinit.sh $T/config O=$builddir
57retval=$?
58if test $retval -gt 1
59then
60 exit 2
61fi
62ncpus=`cpus2use.sh`
63make O=$builddir -j$ncpus $RCU_KMAKE_ARG > $builddir/Make.out 2>&1
64retval=$?
65if test $retval -ne 0 || grep "rcu[^/]*": < $builddir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $builddir/Make.out
66then
67 echo Kernel build error
68 egrep "Stop|Error|error:|warning:" < $builddir/Make.out
69 echo Run aborted.
70 exit 3
71fi
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
new file mode 100755
index 000000000000..baef09f3469b
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -0,0 +1,44 @@
1#!/bin/bash
2#
3# Given the results directories for previous KVM runs of rcutorture,
4# check the build and console output for errors. Given a directory
5# containing results directories, this recursively checks them all.
6#
7# Usage: sh kvm-recheck.sh resdir ...
8#
9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, you can access it online at
21# http://www.gnu.org/licenses/gpl-2.0.html.
22#
23# Copyright (C) IBM Corporation, 2011
24#
25# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
26
27PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH
28for rd in "$@"
29do
30 dirs=`find $rd -name Make.defconfig.out -print | sort | sed -e 's,/[^/]*$,,' | sort -u`
31 for i in $dirs
32 do
33 configfile=`echo $i | sed -e 's/^.*\///'`
34 echo $configfile
35 configcheck.sh $i/.config $i/ConfigFragment
36 parse-build.sh $i/Make.out $configfile
37 parse-rcutorture.sh $i/console.log $configfile
38 parse-console.sh $i/console.log $configfile
39 if test -r $i/Warnings
40 then
41 cat $i/Warnings
42 fi
43 done
44done
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
new file mode 100755
index 000000000000..151b23788935
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm-test-1-rcu.sh
@@ -0,0 +1,192 @@
1#!/bin/bash
2#
3# Run a kvm-based test of the specified tree on the specified configs.
4# Fully automated run and error checking, no graphics console.
5#
6# Execute this in the source tree. Do not run it as a background task
7# because qemu does not seem to like that much.
8#
9# Usage: sh kvm-test-1-rcu.sh config builddir resdir minutes qemu-args bootargs
10#
11# qemu-args defaults to "" -- you will want "-nographic" if running headless.
12# bootargs defaults to "root=/dev/sda noapic selinux=0 console=ttyS0"
13# "initcall_debug debug rcutorture.stat_interval=15"
14# "rcutorture.shutdown_secs=$((minutes * 60))"
15# "rcutorture.rcutorture_runnable=1"
16#
17# Anything you specify for either qemu-args or bootargs is appended to
18# the default values. The "-smp" value is deduced from the contents of
19# the config fragment.
20#
21# More sophisticated argument parsing is clearly needed.
22#
23# This program is free software; you can redistribute it and/or modify
24# it under the terms of the GNU General Public License as published by
25# the Free Software Foundation; either version 2 of the License, or
26# (at your option) any later version.
27#
28# This program is distributed in the hope that it will be useful,
29# but WITHOUT ANY WARRANTY; without even the implied warranty of
30# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31# GNU General Public License for more details.
32#
33# You should have received a copy of the GNU General Public License
34# along with this program; if not, you can access it online at
35# http://www.gnu.org/licenses/gpl-2.0.html.
36#
37# Copyright (C) IBM Corporation, 2011
38#
39# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
40
41grace=120
42
43T=/tmp/kvm-test-1-rcu.sh.$$
44trap 'rm -rf $T' 0
45
46. $KVM/bin/functions.sh
47. $KVPATH/ver_functions.sh
48
49config_template=${1}
50title=`echo $config_template | sed -e 's/^.*\///'`
51builddir=${2}
52if test -z "$builddir" -o ! -d "$builddir" -o ! -w "$builddir"
53then
54 echo "kvm-test-1-rcu.sh :$builddir: Not a writable directory, cannot build into it"
55 exit 1
56fi
57resdir=${3}
58if test -z "$resdir" -o ! -d "$resdir" -o ! -w "$resdir"
59then
60 echo "kvm-test-1-rcu.sh :$resdir: Not a writable directory, cannot build into it"
61 exit 1
62fi
63cp $config_template $resdir/ConfigFragment
64echo ' ---' `date`: Starting build
65echo ' ---' Kconfig fragment at: $config_template >> $resdir/log
66cat << '___EOF___' >> $T
67CONFIG_RCU_TORTURE_TEST=y
68___EOF___
69# Optimizations below this point
70# CONFIG_USB=n
71# CONFIG_SECURITY=n
72# CONFIG_NFS_FS=n
73# CONFIG_SOUND=n
74# CONFIG_INPUT_JOYSTICK=n
75# CONFIG_INPUT_TABLET=n
76# CONFIG_INPUT_TOUCHSCREEN=n
77# CONFIG_INPUT_MISC=n
78# CONFIG_INPUT_MOUSE=n
79# # CONFIG_NET=n # disables console access, so accept the slower build.
80# CONFIG_SCSI=n
81# CONFIG_ATA=n
82# CONFIG_FAT_FS=n
83# CONFIG_MSDOS_FS=n
84# CONFIG_VFAT_FS=n
85# CONFIG_ISO9660_FS=n
86# CONFIG_QUOTA=n
87# CONFIG_HID=n
88# CONFIG_CRYPTO=n
89# CONFIG_PCCARD=n
90# CONFIG_PCMCIA=n
91# CONFIG_CARDBUS=n
92# CONFIG_YENTA=n
93if kvm-build.sh $config_template $builddir $T
94then
95 cp $builddir/Make*.out $resdir
96 cp $builddir/.config $resdir
97 cp $builddir/arch/x86/boot/bzImage $resdir
98 parse-build.sh $resdir/Make.out $title
99else
100 cp $builddir/Make*.out $resdir
101 echo Build failed, not running KVM, see $resdir.
102 exit 1
103fi
104minutes=$4
105seconds=$(($minutes * 60))
106qemu_args=$5
107boot_args=$6
108
109cd $KVM
110kstarttime=`awk 'BEGIN { print systime() }' < /dev/null`
111echo ' ---' `date`: Starting kernel
112
113# Determine the appropriate flavor of qemu command.
114QEMU="`identify_qemu $builddir/vmlinux.o`"
115
116# Generate -smp qemu argument.
117cpu_count=`configNR_CPUS.sh $config_template`
118vcpus=`identify_qemu_vcpus`
119if test $cpu_count -gt $vcpus
120then
121 echo CPU count limited from $cpu_count to $vcpus
122 touch $resdir/Warnings
123 echo CPU count limited from $cpu_count to $vcpus >> $resdir/Warnings
124 cpu_count=$vcpus
125fi
126qemu_args="`specify_qemu_cpus "$QEMU" "$qemu_args" "$cpu_count"`"
127
128# Generate architecture-specific and interaction-specific qemu arguments
129qemu_args="$qemu_args `identify_qemu_args "$QEMU" "$builddir/console.log"`"
130
131# Generate qemu -append arguments
132qemu_append="`identify_qemu_append "$QEMU"`"
133
134# Pull in Kconfig-fragment boot parameters
135boot_args="`configfrag_boot_params "$boot_args" "$config_template"`"
136# Generate CPU-hotplug boot parameters
137boot_args="`rcutorture_param_onoff "$boot_args" $builddir/.config`"
138# Generate rcu_barrier() boot parameter
139boot_args="`rcutorture_param_n_barrier_cbs "$boot_args"`"
140# Pull in standard rcutorture boot arguments
141boot_args="$boot_args rcutorture.stat_interval=15 rcutorture.shutdown_secs=$seconds rcutorture.rcutorture_runnable=1"
142
143echo $QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append \"$qemu_append $boot_args\" > $resdir/qemu-cmd
144if test -n "$RCU_BUILDONLY"
145then
146 echo Build-only run specified, boot/test omitted.
147 exit 0
148fi
149$QEMU $qemu_args -m 512 -kernel $builddir/arch/x86/boot/bzImage -append "$qemu_append $boot_args" &
150qemu_pid=$!
151commandcompleted=0
152echo Monitoring qemu job at pid $qemu_pid
153for ((i=0;i<$seconds;i++))
154do
155 if kill -0 $qemu_pid > /dev/null 2>&1
156 then
157 sleep 1
158 else
159 commandcompleted=1
160 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }' < /dev/null`
161 if test $kruntime -lt $seconds
162 then
163 echo Completed in $kruntime vs. $seconds >> $resdir/Warnings 2>&1
164 else
165 echo ' ---' `date`: Kernel done
166 fi
167 break
168 fi
169done
170if test $commandcompleted -eq 0
171then
172 echo Grace period for qemu job at pid $qemu_pid
173 for ((i=0;i<=$grace;i++))
174 do
175 if kill -0 $qemu_pid > /dev/null 2>&1
176 then
177 sleep 1
178 else
179 break
180 fi
181 if test $i -eq $grace
182 then
183 kruntime=`awk 'BEGIN { print systime() - '"$kstarttime"' }'`
184 echo "!!! Hang at $kruntime vs. $seconds seconds" >> $resdir/Warnings 2>&1
185 kill -KILL $qemu_pid
186 fi
187 done
188fi
189
190cp $builddir/console.log $resdir
191parse-rcutorture.sh $resdir/console.log $title
192parse-console.sh $resdir/console.log $title
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
new file mode 100644
index 000000000000..1b7923bf6a70
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -0,0 +1,210 @@
1#!/bin/bash
2#
3# Run a series of 14 tests under KVM. These are not particularly
4# well-selected or well-tuned, but are the current set. Run from the
5# top level of the source tree.
6#
7# Edit the definitions below to set the locations of the various directories,
8# as well as the test duration.
9#
10# Usage: sh kvm.sh [ options ]
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, you can access it online at
24# http://www.gnu.org/licenses/gpl-2.0.html.
25#
26# Copyright (C) IBM Corporation, 2011
27#
28# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
29
30scriptname=$0
31args="$*"
32
33dur=30
34KVM="`pwd`/tools/testing/selftests/rcutorture"; export KVM
35PATH=${KVM}/bin:$PATH; export PATH
36builddir="${KVM}/b1"
37RCU_INITRD="$KVM/initrd"; export RCU_INITRD
38RCU_KMAKE_ARG=""; export RCU_KMAKE_ARG
39resdir=""
40configs=""
41ds=`date +%Y.%m.%d-%H:%M:%S`
42kversion=""
43
44. functions.sh
45
46usage () {
47 echo "Usage: $scriptname optional arguments:"
48 echo " --bootargs kernel-boot-arguments"
49 echo " --builddir absolute-pathname"
50 echo " --buildonly"
51 echo " --configs \"config-file list\""
52 echo " --datestamp string"
53 echo " --duration minutes"
54 echo " --interactive"
55 echo " --kmake-arg kernel-make-arguments"
56 echo " --kversion vN.NN"
57 echo " --mac nn:nn:nn:nn:nn:nn"
58 echo " --no-initrd"
59 echo " --qemu-args qemu-system-..."
60 echo " --qemu-cmd qemu-system-..."
61 echo " --results absolute-pathname"
62 echo " --relbuilddir relative-pathname"
63 exit 1
64}
65
66while test $# -gt 0
67do
68 case "$1" in
69 --bootargs)
70 checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--'
71 RCU_BOOTARGS="$2"
72 shift
73 ;;
74 --builddir)
75 checkarg --builddir "(absolute pathname)" "$#" "$2" '^/' '^error'
76 builddir=$2
77 gotbuilddir=1
78 shift
79 ;;
80 --buildonly)
81 RCU_BUILDONLY=1; export RCU_BUILDONLY
82 ;;
83 --configs)
84 checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--'
85 configs="$2"
86 shift
87 ;;
88 --datestamp)
89 checkarg --datestamp "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
90 ds=$2
91 shift
92 ;;
93 --duration)
94 checkarg --duration "(minutes)" $# "$2" '^[0-9]*$' '^error'
95 dur=$2
96 shift
97 ;;
98 --interactive)
99 RCU_QEMU_INTERACTIVE=1; export RCU_QEMU_INTERACTIVE
100 ;;
101 --kmake-arg)
102 checkarg --kmake-arg "(kernel make arguments)" $# "$2" '.*' '^error$'
103 RCU_KMAKE_ARG="$2"; export RCU_KMAKE_ARG
104 shift
105 ;;
106 --kversion)
107 checkarg --kversion "(kernel version)" $# "$2" '^v[0-9.]*$' '^error'
108 kversion=$2
109 shift
110 ;;
111 --mac)
112 checkarg --mac "(MAC address)" $# "$2" '^\([0-9a-fA-F]\{2\}:\)\{5\}[0-9a-fA-F]\{2\}$' error
113 RCU_QEMU_MAC=$2; export RCU_QEMU_MAC
114 shift
115 ;;
116 --no-initrd)
117 RCU_INITRD=""; export RCU_INITRD
118 ;;
119 --qemu-args)
120 checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error'
121 RCU_QEMU_ARG="$2"
122 shift
123 ;;
124 --qemu-cmd)
125 checkarg --qemu-cmd "(qemu-system-...)" $# "$2" 'qemu-system-' '^--'
126 RCU_QEMU_CMD="$2"; export RCU_QEMU_CMD
127 shift
128 ;;
129 --relbuilddir)
130 checkarg --relbuilddir "(relative pathname)" "$#" "$2" '^[^/]*$' '^--'
131 relbuilddir=$2
132 gotrelbuilddir=1
133 builddir=${KVM}/${relbuilddir}
134 shift
135 ;;
136 --results)
137 checkarg --results "(absolute pathname)" "$#" "$2" '^/' '^error'
138 resdir=$2
139 shift
140 ;;
141 *)
142 echo Unknown argument $1
143 usage
144 ;;
145 esac
146 shift
147done
148
149CONFIGFRAG=${KVM}/configs; export CONFIGFRAG
150KVPATH=${CONFIGFRAG}/$kversion; export KVPATH
151
152if test -z "$configs"
153then
154 configs="`cat $CONFIGFRAG/$kversion/CFLIST`"
155fi
156
157if test -z "$resdir"
158then
159 resdir=$KVM/res
160 if ! test -e $resdir
161 then
162 mkdir $resdir || :
163 fi
164else
165 if ! test -e $resdir
166 then
167 mkdir -p "$resdir" || :
168 fi
169fi
170mkdir $resdir/$ds
171touch $resdir/$ds/log
172echo $scriptname $args >> $resdir/$ds/log
173
174pwd > $resdir/$ds/testid.txt
175if test -d .git
176then
177 git status >> $resdir/$ds/testid.txt
178 git rev-parse HEAD >> $resdir/$ds/testid.txt
179fi
180builddir=$KVM/b1
181if ! test -e $builddir
182then
183 mkdir $builddir || :
184fi
185
186for CF in $configs
187do
188 # Running TREE01 multiple times creates TREE01, TREE01.2, TREE01.3, ...
189 rd=$resdir/$ds/$CF
190 if test -d "${rd}"
191 then
192 n="`ls -d "${rd}"* | grep '\.[0-9]\+$' |
193 sed -e 's/^.*\.\([0-9]\+\)/\1/' |
194 sort -k1n | tail -1`"
195 if test -z "$n"
196 then
197 rd="${rd}.2"
198 else
199 n="`expr $n + 1`"
200 rd="${rd}.${n}"
201 fi
202 fi
203 mkdir "${rd}"
204 echo Results directory: $rd
205 kvm-test-1-rcu.sh $CONFIGFRAG/$kversion/$CF $builddir $rd $dur "-nographic $RCU_QEMU_ARG" "rcutorture.test_no_idle_hz=1 rcutorture.verbose=1 $RCU_BOOTARGS"
206done
207# Tracing: trace_event=rcu:rcu_grace_period,rcu:rcu_future_grace_period,rcu:rcu_grace_period_init,rcu:rcu_nocb_wake,rcu:rcu_preempt_task,rcu:rcu_unlock_preempted_task,rcu:rcu_quiescent_state_report,rcu:rcu_fqs,rcu:rcu_callback,rcu:rcu_kfree_callback,rcu:rcu_batch_start,rcu:rcu_invoke_callback,rcu:rcu_invoke_kfree_callback,rcu:rcu_batch_end,rcu:rcu_torture_read,rcu:rcu_barrier
208
209echo " --- `date` Test summary:"
210kvm-recheck.sh $resdir/$ds
diff --git a/tools/testing/selftests/rcutorture/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/parse-build.sh
new file mode 100755
index 000000000000..543230951c38
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/parse-build.sh
@@ -0,0 +1,57 @@
1#!/bin/sh
2#
3# Check the build output from an rcutorture run for goodness.
4# The "file" is a pathname on the local system, and "title" is
5# a text string for error-message purposes.
6#
7# The file must contain kernel build output.
8#
9# Usage:
10# sh parse-build.sh file title
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, you can access it online at
24# http://www.gnu.org/licenses/gpl-2.0.html.
25#
26# Copyright (C) IBM Corporation, 2011
27#
28# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
29
30T=$1
31title=$2
32
33. functions.sh
34
35if grep -q CC < $T
36then
37 :
38else
39 print_bug $title no build
40 exit 1
41fi
42
43if grep -q "error:" < $T
44then
45 print_bug $title build errors:
46 grep "error:" < $T
47 exit 2
48fi
49exit 0
50
51if egrep -q "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
52then
53 print_warning $title build errors:
54 egrep "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
55 exit 2
56fi
57exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh
new file mode 100755
index 000000000000..4185d4cab32e
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh
@@ -0,0 +1,41 @@
1#!/bin/sh
2#
3# Check the console output from an rcutorture run for oopses.
4# The "file" is a pathname on the local system, and "title" is
5# a text string for error-message purposes.
6#
7# Usage:
8# sh parse-console.sh file title
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, you can access it online at
22# http://www.gnu.org/licenses/gpl-2.0.html.
23#
24# Copyright (C) IBM Corporation, 2011
25#
26# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
27
28T=/tmp/abat-chk-badness.sh.$$
29trap 'rm -f $T' 0
30
31file="$1"
32title="$2"
33
34. functions.sh
35
36egrep 'Badness|WARNING:|Warn|BUG|===========|Call Trace:|Oops:' < $file | grep -v 'ODEBUG: ' | grep -v 'Warning: unable to open an initial console' > $T
37if test -s $T
38then
39 print_warning Assertion failure in $file $title
40 cat $T
41fi
diff --git a/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
new file mode 100755
index 000000000000..dd0a275d9796
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/bin/parse-rcutorture.sh
@@ -0,0 +1,106 @@
1#!/bin/sh
2#
3# Check the console output from an rcutorture run for goodness.
4# The "file" is a pathname on the local system, and "title" is
5# a text string for error-message purposes.
6#
7# The file must contain rcutorture output, but can be interspersed
8# with other dmesg text.
9#
10# Usage:
11# sh parse-rcutorture.sh file title
12#
13# This program is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, you can access it online at
25# http://www.gnu.org/licenses/gpl-2.0.html.
26#
27# Copyright (C) IBM Corporation, 2011
28#
29# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
30
31T=/tmp/parse-rcutorture.sh.$$
32file="$1"
33title="$2"
34
35trap 'rm -f $T.seq' 0
36
37. functions.sh
38
39# check for presence of rcutorture.txt file
40
41if test -f "$file" -a -r "$file"
42then
43 :
44else
45 echo $title unreadable rcutorture.txt file: $file
46 exit 1
47fi
48
49# check for abject failure
50
51if grep -q FAILURE $file || grep -q -e '-torture.*!!!' $file
52then
53 nerrs=`grep --binary-files=text '!!!' $file | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'`
54 print_bug $title FAILURE, $nerrs instances
55 echo " " $url
56 exit
57fi
58
59grep --binary-files=text 'torture:.*ver:' $file | grep --binary-files=text -v '(null)' | sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
60awk '
61BEGIN {
62 ver = 0;
63 badseq = 0;
64 }
65
66 {
67 if (!badseq && ($5 + 0 != $5 || $5 <= ver)) {
68 badseqno1 = ver;
69 badseqno2 = $5;
70 badseqnr = NR;
71 badseq = 1;
72 }
73 ver = $5
74 }
75
76END {
77 if (badseq) {
78 if (badseqno1 == badseqno2 && badseqno2 == ver)
79 print "RCU GP HANG at " ver " rcutorture stat " badseqnr;
80 else
81 print "BAD SEQ " badseqno1 ":" badseqno2 " last:" ver " RCU version " badseqnr;
82 }
83 }' > $T.seq
84
85if grep -q SUCCESS $file
86then
87 if test -s $T.seq
88 then
89 print_warning $title $title `cat $T.seq`
90 echo " " $file
91 exit 2
92 fi
93else
94 if grep -q RCU_HOTPLUG $file
95 then
96 print_warning HOTPLUG FAILURES $title `cat $T.seq`
97 echo " " $file
98 exit 3
99 fi
100 echo $title no success message, `grep --binary-files=text 'ver:' $file | wc -l` successful RCU version messages
101 if test -s $T.seq
102 then
103 print_warning $title `cat $T.seq`
104 fi
105 exit 2
106fi
diff --git a/tools/testing/selftests/rcutorture/configs/CFLIST b/tools/testing/selftests/rcutorture/configs/CFLIST
new file mode 100644
index 000000000000..cd3d29cb0a47
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/CFLIST
@@ -0,0 +1,13 @@
1TREE01
2TREE02
3TREE03
4TREE04
5TREE05
6TREE06
7TREE07
8TREE08
9TREE09
10SRCU-N
11SRCU-P
12TINY01
13TINY02
diff --git a/tools/testing/selftests/rcutorture/configs/SRCU-N b/tools/testing/selftests/rcutorture/configs/SRCU-N
new file mode 100644
index 000000000000..10a0e27f4c75
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/SRCU-N
@@ -0,0 +1,8 @@
1CONFIG_RCU_TRACE=n
2CONFIG_SMP=y
3CONFIG_NR_CPUS=8
4CONFIG_HOTPLUG_CPU=y
5CONFIG_PREEMPT_NONE=y
6CONFIG_PREEMPT_VOLUNTARY=n
7CONFIG_PREEMPT=n
8CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/SRCU-N.boot b/tools/testing/selftests/rcutorture/configs/SRCU-N.boot
new file mode 100644
index 000000000000..238bfe3bd0cc
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/SRCU-N.boot
@@ -0,0 +1 @@
rcutorture.torture_type=srcu
diff --git a/tools/testing/selftests/rcutorture/configs/SRCU-P b/tools/testing/selftests/rcutorture/configs/SRCU-P
new file mode 100644
index 000000000000..6650e00c6d91
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/SRCU-P
@@ -0,0 +1,8 @@
1CONFIG_RCU_TRACE=n
2CONFIG_SMP=y
3CONFIG_NR_CPUS=8
4CONFIG_HOTPLUG_CPU=y
5CONFIG_PREEMPT_NONE=n
6CONFIG_PREEMPT_VOLUNTARY=n
7CONFIG_PREEMPT=y
8CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/SRCU-P.boot b/tools/testing/selftests/rcutorture/configs/SRCU-P.boot
new file mode 100644
index 000000000000..238bfe3bd0cc
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/SRCU-P.boot
@@ -0,0 +1 @@
rcutorture.torture_type=srcu
diff --git a/tools/testing/selftests/rcutorture/configs/TINY01 b/tools/testing/selftests/rcutorture/configs/TINY01
new file mode 100644
index 000000000000..0c2823f21712
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TINY01
@@ -0,0 +1,13 @@
1CONFIG_SMP=n
2CONFIG_PREEMPT_NONE=y
3CONFIG_PREEMPT_VOLUNTARY=n
4CONFIG_PREEMPT=n
5#CHECK#CONFIG_TINY_RCU=y
6CONFIG_HZ_PERIODIC=n
7CONFIG_NO_HZ_IDLE=y
8CONFIG_NO_HZ_FULL=n
9CONFIG_RCU_TRACE=n
10CONFIG_DEBUG_LOCK_ALLOC=n
11CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
12CONFIG_PREEMPT_COUNT=n
13CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TINY02 b/tools/testing/selftests/rcutorture/configs/TINY02
new file mode 100644
index 000000000000..e5072d7528b6
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TINY02
@@ -0,0 +1,13 @@
1CONFIG_SMP=n
2CONFIG_PREEMPT_NONE=y
3CONFIG_PREEMPT_VOLUNTARY=n
4CONFIG_PREEMPT=n
5#CHECK#CONFIG_TINY_RCU=y
6CONFIG_HZ_PERIODIC=y
7CONFIG_NO_HZ_IDLE=n
8CONFIG_NO_HZ_FULL=n
9CONFIG_RCU_TRACE=y
10CONFIG_DEBUG_LOCK_ALLOC=y
11CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
12CONFIG_PREEMPT_COUNT=y
13CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE01 b/tools/testing/selftests/rcutorture/configs/TREE01
new file mode 100644
index 000000000000..141119a00044
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE01
@@ -0,0 +1,23 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=y
11CONFIG_RCU_TRACE=y
12CONFIG_HOTPLUG_CPU=y
13CONFIG_RCU_FANOUT=8
14CONFIG_RCU_FANOUT_EXACT=n
15CONFIG_RCU_NOCB_CPU=y
16CONFIG_RCU_NOCB_CPU_ZERO=y
17CONFIG_DEBUG_LOCK_ALLOC=n
18CONFIG_PROVE_RCU_DELAY=n
19CONFIG_RCU_CPU_STALL_INFO=n
20CONFIG_RCU_CPU_STALL_VERBOSE=n
21CONFIG_RCU_BOOST=n
22CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
23CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE01.boot b/tools/testing/selftests/rcutorture/configs/TREE01.boot
new file mode 100644
index 000000000000..0fc8a3428938
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE01.boot
@@ -0,0 +1 @@
rcutorture.torture_type=rcu_bh
diff --git a/tools/testing/selftests/rcutorture/configs/TREE02 b/tools/testing/selftests/rcutorture/configs/TREE02
new file mode 100644
index 000000000000..2d4d09608528
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE02
@@ -0,0 +1,26 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=n
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=3
16CONFIG_RCU_FANOUT_LEAF=3
17CONFIG_RCU_FANOUT_EXACT=n
18CONFIG_RCU_NOCB_CPU=n
19CONFIG_DEBUG_LOCK_ALLOC=y
20CONFIG_PROVE_LOCKING=n
21CONFIG_PROVE_RCU_DELAY=n
22CONFIG_RCU_CPU_STALL_INFO=n
23CONFIG_RCU_CPU_STALL_VERBOSE=y
24CONFIG_RCU_BOOST=n
25CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
26CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE03 b/tools/testing/selftests/rcutorture/configs/TREE03
new file mode 100644
index 000000000000..a47de5be8a04
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE03
@@ -0,0 +1,23 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=y
8CONFIG_NO_HZ_IDLE=n
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_TRACE=y
11CONFIG_HOTPLUG_CPU=y
12CONFIG_RCU_FANOUT=4
13CONFIG_RCU_FANOUT_LEAF=4
14CONFIG_RCU_FANOUT_EXACT=n
15CONFIG_RCU_NOCB_CPU=n
16CONFIG_DEBUG_LOCK_ALLOC=n
17CONFIG_PROVE_RCU_DELAY=n
18CONFIG_RCU_CPU_STALL_INFO=n
19CONFIG_RCU_CPU_STALL_VERBOSE=n
20CONFIG_RCU_BOOST=y
21CONFIG_RCU_BOOST_PRIO=2
22CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
23CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE04 b/tools/testing/selftests/rcutorture/configs/TREE04
new file mode 100644
index 000000000000..8d839b86a1d5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE04
@@ -0,0 +1,25 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=y
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=n
6#CHECK#CONFIG_TREE_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=n
9CONFIG_NO_HZ_FULL=y
10CONFIG_NO_HZ_FULL_ALL=y
11CONFIG_RCU_FAST_NO_HZ=y
12CONFIG_RCU_TRACE=y
13CONFIG_HOTPLUG_CPU=n
14CONFIG_SUSPEND=n
15CONFIG_HIBERNATION=n
16CONFIG_RCU_FANOUT=2
17CONFIG_RCU_FANOUT_LEAF=2
18CONFIG_RCU_FANOUT_EXACT=n
19CONFIG_RCU_NOCB_CPU=n
20CONFIG_DEBUG_LOCK_ALLOC=n
21CONFIG_PROVE_RCU_DELAY=n
22CONFIG_RCU_CPU_STALL_INFO=y
23CONFIG_RCU_CPU_STALL_VERBOSE=y
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
25CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE04.boot b/tools/testing/selftests/rcutorture/configs/TREE04.boot
new file mode 100644
index 000000000000..0fc8a3428938
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE04.boot
@@ -0,0 +1 @@
rcutorture.torture_type=rcu_bh
diff --git a/tools/testing/selftests/rcutorture/configs/TREE05 b/tools/testing/selftests/rcutorture/configs/TREE05
new file mode 100644
index 000000000000..b5ba72ea25cb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE05
@@ -0,0 +1,25 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=y
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=n
6#CHECK#CONFIG_TREE_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=n
12CONFIG_HOTPLUG_CPU=y
13CONFIG_RCU_FANOUT=6
14CONFIG_RCU_FANOUT_LEAF=6
15CONFIG_RCU_FANOUT_EXACT=n
16CONFIG_RCU_NOCB_CPU=y
17CONFIG_RCU_NOCB_CPU_NONE=y
18CONFIG_DEBUG_LOCK_ALLOC=y
19CONFIG_PROVE_LOCKING=y
20CONFIG_PROVE_RCU=y
21CONFIG_PROVE_RCU_DELAY=y
22CONFIG_RCU_CPU_STALL_INFO=n
23CONFIG_RCU_CPU_STALL_VERBOSE=n
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
25CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE05.boot b/tools/testing/selftests/rcutorture/configs/TREE05.boot
new file mode 100644
index 000000000000..3b42b8b033cd
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE05.boot
@@ -0,0 +1 @@
rcutorture.torture_type=sched
diff --git a/tools/testing/selftests/rcutorture/configs/TREE06 b/tools/testing/selftests/rcutorture/configs/TREE06
new file mode 100644
index 000000000000..7c95ab48d29f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE06
@@ -0,0 +1,26 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=8
3CONFIG_PREEMPT_NONE=y
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=n
6#CHECK#CONFIG_TREE_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=n
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=6
16CONFIG_RCU_FANOUT_LEAF=6
17CONFIG_RCU_FANOUT_EXACT=y
18CONFIG_RCU_NOCB_CPU=n
19CONFIG_DEBUG_LOCK_ALLOC=y
20CONFIG_PROVE_LOCKING=y
21CONFIG_PROVE_RCU=y
22CONFIG_PROVE_RCU_DELAY=n
23CONFIG_RCU_CPU_STALL_INFO=n
24CONFIG_RCU_CPU_STALL_VERBOSE=n
25CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
26CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE07 b/tools/testing/selftests/rcutorture/configs/TREE07
new file mode 100644
index 000000000000..1467404bdec1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE07
@@ -0,0 +1,24 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=16
3CONFIG_PREEMPT_NONE=y
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=n
6#CHECK#CONFIG_TREE_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=n
9CONFIG_NO_HZ_FULL=y
10CONFIG_NO_HZ_FULL_ALL=y
11CONFIG_NO_HZ_FULL_SYSIDLE=y
12CONFIG_RCU_FAST_NO_HZ=n
13CONFIG_RCU_TRACE=y
14CONFIG_HOTPLUG_CPU=y
15CONFIG_RCU_FANOUT=2
16CONFIG_RCU_FANOUT_LEAF=2
17CONFIG_RCU_FANOUT_EXACT=n
18CONFIG_RCU_NOCB_CPU=n
19CONFIG_DEBUG_LOCK_ALLOC=n
20CONFIG_PROVE_RCU_DELAY=n
21CONFIG_RCU_CPU_STALL_INFO=y
22CONFIG_RCU_CPU_STALL_VERBOSE=n
23CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
24CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE08 b/tools/testing/selftests/rcutorture/configs/TREE08
new file mode 100644
index 000000000000..7d097a61ac2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE08
@@ -0,0 +1,26 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=16
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=n
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=3
16CONFIG_RCU_FANOUT_EXACT=y
17CONFIG_RCU_FANOUT_LEAF=2
18CONFIG_RCU_NOCB_CPU=y
19CONFIG_RCU_NOCB_CPU_ALL=y
20CONFIG_DEBUG_LOCK_ALLOC=n
21CONFIG_PROVE_RCU_DELAY=n
22CONFIG_RCU_CPU_STALL_INFO=n
23CONFIG_RCU_CPU_STALL_VERBOSE=n
24CONFIG_RCU_BOOST=n
25CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
26CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE08-T b/tools/testing/selftests/rcutorture/configs/TREE08-T
new file mode 100644
index 000000000000..442c4e450ab3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE08-T
@@ -0,0 +1,26 @@
1CONFIG_SMP=y
2CONFIG_NR_CPUS=16
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_FAST_NO_HZ=n
11CONFIG_RCU_TRACE=y
12CONFIG_HOTPLUG_CPU=n
13CONFIG_SUSPEND=n
14CONFIG_HIBERNATION=n
15CONFIG_RCU_FANOUT=3
16CONFIG_RCU_FANOUT_EXACT=y
17CONFIG_RCU_FANOUT_LEAF=2
18CONFIG_RCU_NOCB_CPU=y
19CONFIG_RCU_NOCB_CPU_ALL=y
20CONFIG_DEBUG_LOCK_ALLOC=n
21CONFIG_PROVE_RCU_DELAY=n
22CONFIG_RCU_CPU_STALL_INFO=n
23CONFIG_RCU_CPU_STALL_VERBOSE=n
24CONFIG_RCU_BOOST=n
25CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
26CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/TREE09 b/tools/testing/selftests/rcutorture/configs/TREE09
new file mode 100644
index 000000000000..0d1ec0d3dfee
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/TREE09
@@ -0,0 +1,21 @@
1CONFIG_SMP=n
2CONFIG_NR_CPUS=1
3CONFIG_PREEMPT_NONE=n
4CONFIG_PREEMPT_VOLUNTARY=n
5CONFIG_PREEMPT=y
6#CHECK#CONFIG_TREE_PREEMPT_RCU=y
7CONFIG_HZ_PERIODIC=n
8CONFIG_NO_HZ_IDLE=y
9CONFIG_NO_HZ_FULL=n
10CONFIG_RCU_TRACE=n
11CONFIG_HOTPLUG_CPU=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_RCU_NOCB_CPU=n
15CONFIG_DEBUG_LOCK_ALLOC=n
16CONFIG_PROVE_RCU_DELAY=n
17CONFIG_RCU_CPU_STALL_INFO=n
18CONFIG_RCU_CPU_STALL_VERBOSE=n
19CONFIG_RCU_BOOST=n
20CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
21CONFIG_PRINTK_TIME=y
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST b/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..d3ef873eb6e7
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=8
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=y
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=n
11#CHECK#CONFIG_TREE_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/N2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..02e418572b1b
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/N3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b3100f69c8cf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/N4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..c56b44530725
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=y
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=n
11#CHECK#CONFIG_TREE_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/N5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/N5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..90d924fea9e9
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/N5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=6
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=y
9CONFIG_HOTPLUG_CPU=n
10CONFIG_SUSPEND=n
11CONFIG_HIBERNATION=n
12CONFIG_PREEMPT_NONE=y
13CONFIG_PREEMPT_VOLUNTARY=n
14CONFIG_PREEMPT=n
15#CHECK#CONFIG_TREE_RCU=y
16CONFIG_RCU_TORTURE_TEST=m
17CONFIG_MODULE_UNLOAD=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/NT1-nh b/tools/testing/selftests/rcutorture/configs/v0.0/NT1-nh
new file mode 100644
index 000000000000..023f312a931c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/NT1-nh
@@ -0,0 +1,23 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TRACE=y
3CONFIG_RCU_TORTURE_TEST=m
4CONFIG_MODULE_UNLOAD=y
5CONFIG_SUSPEND=n
6CONFIG_HIBERNATION=n
7#
8CONFIG_SMP=n
9#
10CONFIG_HOTPLUG_CPU=n
11#
12CONFIG_NO_HZ=n
13#
14CONFIG_PREEMPT_NONE=y
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=n
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/NT3-NH b/tools/testing/selftests/rcutorture/configs/v0.0/NT3-NH
new file mode 100644
index 000000000000..6fd0235dae73
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/NT3-NH
@@ -0,0 +1,20 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=y
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=n
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..f72402d7c13d
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,19 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=8
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=n
8CONFIG_HOTPLUG_CPU=y
9CONFIG_PREEMPT_NONE=n
10CONFIG_PREEMPT_VOLUNTARY=n
11CONFIG_PREEMPT=y
12#CHECK#CONFIG_TREE_PREEMPT_RCU=y
13CONFIG_RCU_TORTURE_TEST=m
14CONFIG_MODULE_UNLOAD=y
15CONFIG_SYSFS_DEPRECATED_V2=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_PRINTK_TIME=y
19
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/P2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..0f3b667d2a9f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/P3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b035e141bf2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v0.0/P4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..3ccf6a9447f5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=n
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=y
11#CHECK#CONFIG_TREE_PREEMPT_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_RT_MUTEXES=y
15CONFIG_RCU_BOOST=y
16CONFIG_RCU_BOOST_PRIO=2
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/P5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v0.0/P5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..ef624ce73d8e
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/P5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,28 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=6
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=y
8CONFIG_HOTPLUG_CPU=n
9CONFIG_SUSPEND=n
10CONFIG_HIBERNATION=n
11CONFIG_PREEMPT_NONE=n
12CONFIG_PREEMPT_VOLUNTARY=n
13CONFIG_PREEMPT=y
14#CHECK#CONFIG_TREE_PREEMPT_RCU=y
15CONFIG_DEBUG_KERNEL=y
16CONFIG_PROVE_RCU_DELAY=y
17CONFIG_DEBUG_OBJECTS=y
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
19CONFIG_RT_MUTEXES=y
20CONFIG_RCU_BOOST=y
21CONFIG_RCU_BOOST_PRIO=2
22CONFIG_RCU_TORTURE_TEST=m
23CONFIG_MODULE_UNLOAD=y
24CONFIG_SYSFS_DEPRECATED_V2=y
25CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y
27CONFIG_PRINTK_TIME=y
28
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/PT1-nh b/tools/testing/selftests/rcutorture/configs/v0.0/PT1-nh
new file mode 100644
index 000000000000..e3361c3894a1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/PT1-nh
@@ -0,0 +1,23 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_BOOST=y
3CONFIG_RCU_BOOST_PRIO=2
4CONFIG_RCU_TRACE=y
5CONFIG_RCU_TORTURE_TEST=m
6CONFIG_MODULE_UNLOAD=y
7CONFIG_SUSPEND=n
8CONFIG_HIBERNATION=n
9#
10CONFIG_SMP=n
11#
12CONFIG_HOTPLUG_CPU=n
13#
14CONFIG_NO_HZ=n
15#
16CONFIG_PREEMPT_NONE=n
17CONFIG_PREEMPT_VOLUNTARY=n
18CONFIG_PREEMPT=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/PT2-NH b/tools/testing/selftests/rcutorture/configs/v0.0/PT2-NH
new file mode 100644
index 000000000000..64abfc3b4d94
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/PT2-NH
@@ -0,0 +1,22 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=n
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
new file mode 100644
index 000000000000..e8052539af54
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v0.0/ver_functions.sh
@@ -0,0 +1,35 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 echo $1
28}
29
30# rcutorture_param_onoff bootparam-string config-file
31#
32# Adds onoff rcutorture module parameters to kernels having it.
33rcutorture_param_onoff () {
34 echo $1
35}
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/CFLIST b/tools/testing/selftests/rcutorture/configs/v3.12/CFLIST
new file mode 100644
index 000000000000..da4cbc668f2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/CFLIST
@@ -0,0 +1,17 @@
1sysidleY.2013.06.19a
2sysidleN.2013.06.19a
3P1-S-T-NH-SD-SMP-HP
4P2-2-t-nh-sd-SMP-hp
5P3-3-T-nh-SD-SMP-hp
6P4-A-t-NH-sd-SMP-HP
7P5-U-T-NH-sd-SMP-hp
8P6---t-nh-SD-smp-hp
9N1-S-T-NH-SD-SMP-HP
10N2-2-t-nh-sd-SMP-hp
11N3-3-T-nh-SD-SMP-hp
12N4-A-t-NH-sd-SMP-HP
13N5-U-T-NH-sd-SMP-hp
14PT1-nh
15PT2-NH
16NT1-nh
17NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/N1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..d81e11d280aa
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,19 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_FAST_NO_HZ=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=8
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=n
8CONFIG_HOTPLUG_CPU=y
9CONFIG_PREEMPT_NONE=y
10CONFIG_PREEMPT_VOLUNTARY=n
11CONFIG_PREEMPT=n
12#CHECK#CONFIG_TREE_RCU=y
13CONFIG_RCU_TORTURE_TEST=m
14CONFIG_MODULE_UNLOAD=y
15CONFIG_SYSFS_DEPRECATED_V2=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_PRINTK_TIME=y
19
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/N2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..02e418572b1b
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/N3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b3100f69c8cf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/N4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..c56b44530725
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=y
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=n
11#CHECK#CONFIG_TREE_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/N5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..90d924fea9e9
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=6
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=y
9CONFIG_HOTPLUG_CPU=n
10CONFIG_SUSPEND=n
11CONFIG_HIBERNATION=n
12CONFIG_PREEMPT_NONE=y
13CONFIG_PREEMPT_VOLUNTARY=n
14CONFIG_PREEMPT=n
15#CHECK#CONFIG_TREE_RCU=y
16CONFIG_RCU_TORTURE_TEST=m
17CONFIG_MODULE_UNLOAD=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N6---t-nh-SD-smp-hp b/tools/testing/selftests/rcutorture/configs/v3.12/N6---t-nh-SD-smp-hp
new file mode 100644
index 000000000000..0ccc36d72738
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N6---t-nh-SD-smp-hp
@@ -0,0 +1,19 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_NR_CPUS=1
5CONFIG_RCU_FANOUT_EXACT=n
6CONFIG_HOTPLUG_CPU=n
7CONFIG_SUSPEND=n
8CONFIG_HIBERNATION=n
9CONFIG_PREEMPT_NONE=y
10CONFIG_PREEMPT_VOLUNTARY=n
11CONFIG_PREEMPT=n
12#CHECK#CONFIG_TREE_RCU=y
13CONFIG_RCU_TORTURE_TEST=m
14CONFIG_MODULE_UNLOAD=y
15CONFIG_SYSFS_DEPRECATED_V2=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_PRINTK_TIME=y
19
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N7-4-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/N7-4-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..3f640cf84973
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N7-4-T-NH-SD-SMP-HP
@@ -0,0 +1,26 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=2
7CONFIG_NR_CPUS=16
8CONFIG_RCU_FANOUT_EXACT=n
9CONFIG_HOTPLUG_CPU=y
10CONFIG_RCU_NOCB_CPU=y
11CONFIG_RCU_NOCB_CPU_NONE=y
12CONFIG_RCU_NOCB_CPU_ZERO=n
13CONFIG_RCU_NOCB_CPU_ALL=n
14CONFIG_SUSPEND=n
15CONFIG_HIBERNATION=n
16CONFIG_PREEMPT_NONE=y
17CONFIG_PREEMPT_VOLUNTARY=n
18CONFIG_PREEMPT=n
19#CHECK#CONFIG_TREE_RCU=y
20CONFIG_RCU_TORTURE_TEST=m
21CONFIG_MODULE_UNLOAD=y
22CONFIG_SYSFS_DEPRECATED_V2=y
23CONFIG_IKCONFIG=y
24CONFIG_IKCONFIG_PROC=y
25CONFIG_PRINTK_TIME=y
26
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/N8-2-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/N8-2-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..285da2dd8ac3
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/N8-2-T-NH-SD-SMP-HP
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=14
7CONFIG_NR_CPUS=16
8CONFIG_RCU_FANOUT_EXACT=y
9CONFIG_HOTPLUG_CPU=y
10CONFIG_SUSPEND=n
11CONFIG_HIBERNATION=n
12CONFIG_PREEMPT_NONE=y
13CONFIG_PREEMPT_VOLUNTARY=n
14CONFIG_PREEMPT=n
15#CHECK#CONFIG_TREE_RCU=y
16CONFIG_RCU_TORTURE_TEST=m
17CONFIG_MODULE_UNLOAD=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/NT1-nh b/tools/testing/selftests/rcutorture/configs/v3.12/NT1-nh
new file mode 100644
index 000000000000..023f312a931c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/NT1-nh
@@ -0,0 +1,23 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TRACE=y
3CONFIG_RCU_TORTURE_TEST=m
4CONFIG_MODULE_UNLOAD=y
5CONFIG_SUSPEND=n
6CONFIG_HIBERNATION=n
7#
8CONFIG_SMP=n
9#
10CONFIG_HOTPLUG_CPU=n
11#
12CONFIG_NO_HZ=n
13#
14CONFIG_PREEMPT_NONE=y
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=n
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/NT3-NH b/tools/testing/selftests/rcutorture/configs/v3.12/NT3-NH
new file mode 100644
index 000000000000..6fd0235dae73
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/NT3-NH
@@ -0,0 +1,20 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=y
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=n
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/P1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..9647c44cf4b7
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_RCU_FAST_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=8
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=n
9CONFIG_HOTPLUG_CPU=y
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/P2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..0f3b667d2a9f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/P3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b035e141bf2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/P4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..3ccf6a9447f5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=n
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=y
11#CHECK#CONFIG_TREE_PREEMPT_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_RT_MUTEXES=y
15CONFIG_RCU_BOOST=y
16CONFIG_RCU_BOOST_PRIO=2
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/P5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..ef624ce73d8e
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,28 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=6
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=y
8CONFIG_HOTPLUG_CPU=n
9CONFIG_SUSPEND=n
10CONFIG_HIBERNATION=n
11CONFIG_PREEMPT_NONE=n
12CONFIG_PREEMPT_VOLUNTARY=n
13CONFIG_PREEMPT=y
14#CHECK#CONFIG_TREE_PREEMPT_RCU=y
15CONFIG_DEBUG_KERNEL=y
16CONFIG_PROVE_RCU_DELAY=y
17CONFIG_DEBUG_OBJECTS=y
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
19CONFIG_RT_MUTEXES=y
20CONFIG_RCU_BOOST=y
21CONFIG_RCU_BOOST_PRIO=2
22CONFIG_RCU_TORTURE_TEST=m
23CONFIG_MODULE_UNLOAD=y
24CONFIG_SYSFS_DEPRECATED_V2=y
25CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y
27CONFIG_PRINTK_TIME=y
28
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P6---t-nh-SD-smp-hp b/tools/testing/selftests/rcutorture/configs/v3.12/P6---t-nh-SD-smp-hp
new file mode 100644
index 000000000000..f4c9175828bf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P6---t-nh-SD-smp-hp
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=n
4CONFIG_RCU_FANOUT_EXACT=n
5CONFIG_HOTPLUG_CPU=n
6CONFIG_SUSPEND=n
7CONFIG_HIBERNATION=n
8CONFIG_PREEMPT_NONE=n
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=y
11CONFIG_TREE_PREEMPT_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..77a8c5b75763
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP
@@ -0,0 +1,30 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=16
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_RCU_NOCB_CPU=y
9CONFIG_RCU_NOCB_CPU_NONE=n
10CONFIG_RCU_NOCB_CPU_ZERO=n
11CONFIG_RCU_NOCB_CPU_ALL=y
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_PREEMPT_NONE=n
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=y
17#CHECK#CONFIG_TREE_PREEMPT_RCU=y
18CONFIG_RCU_TORTURE_TEST=m
19CONFIG_MODULE_UNLOAD=y
20CONFIG_PROVE_LOCKING=y
21CONFIG_PROVE_RCU=y
22CONFIG_DEBUG_KERNEL=y
23CONFIG_DEBUG_OBJECTS=y
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
25CONFIG_SYSFS_DEPRECATED_V2=y
26CONFIG_SLUB=y
27CONFIG_IKCONFIG=y
28CONFIG_IKCONFIG_PROC=y
29CONFIG_PRINTK_TIME=y
30
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-all b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-all
new file mode 100644
index 000000000000..0eecebc6e95f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-all
@@ -0,0 +1,30 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=16
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_RCU_NOCB_CPU=y
9CONFIG_RCU_NOCB_CPU_NONE=y
10CONFIG_RCU_NOCB_CPU_ZERO=n
11CONFIG_RCU_NOCB_CPU_ALL=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_PREEMPT_NONE=n
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=y
17#CHECK#CONFIG_TREE_PREEMPT_RCU=y
18CONFIG_RCU_TORTURE_TEST=m
19CONFIG_MODULE_UNLOAD=y
20CONFIG_PROVE_LOCKING=y
21CONFIG_PROVE_RCU=y
22CONFIG_DEBUG_KERNEL=y
23CONFIG_DEBUG_OBJECTS=y
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
25CONFIG_SYSFS_DEPRECATED_V2=y
26CONFIG_SLUB=y
27CONFIG_IKCONFIG=y
28CONFIG_IKCONFIG_PROC=y
29CONFIG_PRINTK_TIME=y
30
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-none b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-none
new file mode 100644
index 000000000000..0eecebc6e95f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-HP-none
@@ -0,0 +1,30 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=16
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_RCU_NOCB_CPU=y
9CONFIG_RCU_NOCB_CPU_NONE=y
10CONFIG_RCU_NOCB_CPU_ZERO=n
11CONFIG_RCU_NOCB_CPU_ALL=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_PREEMPT_NONE=n
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=y
17#CHECK#CONFIG_TREE_PREEMPT_RCU=y
18CONFIG_RCU_TORTURE_TEST=m
19CONFIG_MODULE_UNLOAD=y
20CONFIG_PROVE_LOCKING=y
21CONFIG_PROVE_RCU=y
22CONFIG_DEBUG_KERNEL=y
23CONFIG_DEBUG_OBJECTS=y
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
25CONFIG_SYSFS_DEPRECATED_V2=y
26CONFIG_SLUB=y
27CONFIG_IKCONFIG=y
28CONFIG_IKCONFIG_PROC=y
29CONFIG_PRINTK_TIME=y
30
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-hp
new file mode 100644
index 000000000000..588bc70420cd
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/P7-4-T-NH-SD-SMP-hp
@@ -0,0 +1,30 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=16
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_RCU_NOCB_CPU=y
9CONFIG_RCU_NOCB_CPU_NONE=n
10CONFIG_RCU_NOCB_CPU_ZERO=y
11CONFIG_RCU_NOCB_CPU_ALL=n
12CONFIG_SUSPEND=n
13CONFIG_HIBERNATION=n
14CONFIG_PREEMPT_NONE=n
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=y
17#CHECK#CONFIG_TREE_PREEMPT_RCU=y
18CONFIG_RCU_TORTURE_TEST=m
19CONFIG_MODULE_UNLOAD=y
20CONFIG_PROVE_LOCKING=y
21CONFIG_PROVE_RCU=y
22CONFIG_DEBUG_KERNEL=y
23CONFIG_DEBUG_OBJECTS=y
24CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
25CONFIG_SYSFS_DEPRECATED_V2=y
26CONFIG_SLUB=y
27CONFIG_IKCONFIG=y
28CONFIG_IKCONFIG_PROC=y
29CONFIG_PRINTK_TIME=y
30
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/PT1-nh b/tools/testing/selftests/rcutorture/configs/v3.12/PT1-nh
new file mode 100644
index 000000000000..e3361c3894a1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/PT1-nh
@@ -0,0 +1,23 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_BOOST=y
3CONFIG_RCU_BOOST_PRIO=2
4CONFIG_RCU_TRACE=y
5CONFIG_RCU_TORTURE_TEST=m
6CONFIG_MODULE_UNLOAD=y
7CONFIG_SUSPEND=n
8CONFIG_HIBERNATION=n
9#
10CONFIG_SMP=n
11#
12CONFIG_HOTPLUG_CPU=n
13#
14CONFIG_NO_HZ=n
15#
16CONFIG_PREEMPT_NONE=n
17CONFIG_PREEMPT_VOLUNTARY=n
18CONFIG_PREEMPT=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.12/PT2-NH b/tools/testing/selftests/rcutorture/configs/v3.12/PT2-NH
new file mode 100644
index 000000000000..64abfc3b4d94
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.12/PT2-NH
@@ -0,0 +1,22 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=n
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST b/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.3/N1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..d81e11d280aa
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/N1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,19 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_FAST_NO_HZ=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=8
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=n
8CONFIG_HOTPLUG_CPU=y
9CONFIG_PREEMPT_NONE=y
10CONFIG_PREEMPT_VOLUNTARY=n
11CONFIG_PREEMPT=n
12#CHECK#CONFIG_TREE_RCU=y
13CONFIG_RCU_TORTURE_TEST=m
14CONFIG_MODULE_UNLOAD=y
15CONFIG_SYSFS_DEPRECATED_V2=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_PRINTK_TIME=y
19
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/N2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/N2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..02e418572b1b
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/N2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/N3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/N3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b3100f69c8cf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/N3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/N4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.3/N4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..c56b44530725
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/N4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=y
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=n
11#CHECK#CONFIG_TREE_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/N5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/N5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..90d924fea9e9
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/N5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=6
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=y
9CONFIG_HOTPLUG_CPU=n
10CONFIG_SUSPEND=n
11CONFIG_HIBERNATION=n
12CONFIG_PREEMPT_NONE=y
13CONFIG_PREEMPT_VOLUNTARY=n
14CONFIG_PREEMPT=n
15#CHECK#CONFIG_TREE_RCU=y
16CONFIG_RCU_TORTURE_TEST=m
17CONFIG_MODULE_UNLOAD=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/NT1-nh b/tools/testing/selftests/rcutorture/configs/v3.3/NT1-nh
new file mode 100644
index 000000000000..023f312a931c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/NT1-nh
@@ -0,0 +1,23 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TRACE=y
3CONFIG_RCU_TORTURE_TEST=m
4CONFIG_MODULE_UNLOAD=y
5CONFIG_SUSPEND=n
6CONFIG_HIBERNATION=n
7#
8CONFIG_SMP=n
9#
10CONFIG_HOTPLUG_CPU=n
11#
12CONFIG_NO_HZ=n
13#
14CONFIG_PREEMPT_NONE=y
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=n
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/NT3-NH b/tools/testing/selftests/rcutorture/configs/v3.3/NT3-NH
new file mode 100644
index 000000000000..6fd0235dae73
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/NT3-NH
@@ -0,0 +1,20 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=y
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=n
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.3/P1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..9647c44cf4b7
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/P1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_RCU_FAST_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=8
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=n
9CONFIG_HOTPLUG_CPU=y
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/P2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/P2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..0f3b667d2a9f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/P2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/P3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/P3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b035e141bf2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/P3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/P4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.3/P4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..3ccf6a9447f5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/P4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=n
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=y
11#CHECK#CONFIG_TREE_PREEMPT_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_RT_MUTEXES=y
15CONFIG_RCU_BOOST=y
16CONFIG_RCU_BOOST_PRIO=2
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/P5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.3/P5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..ef624ce73d8e
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/P5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,28 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=6
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=y
8CONFIG_HOTPLUG_CPU=n
9CONFIG_SUSPEND=n
10CONFIG_HIBERNATION=n
11CONFIG_PREEMPT_NONE=n
12CONFIG_PREEMPT_VOLUNTARY=n
13CONFIG_PREEMPT=y
14#CHECK#CONFIG_TREE_PREEMPT_RCU=y
15CONFIG_DEBUG_KERNEL=y
16CONFIG_PROVE_RCU_DELAY=y
17CONFIG_DEBUG_OBJECTS=y
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
19CONFIG_RT_MUTEXES=y
20CONFIG_RCU_BOOST=y
21CONFIG_RCU_BOOST_PRIO=2
22CONFIG_RCU_TORTURE_TEST=m
23CONFIG_MODULE_UNLOAD=y
24CONFIG_SYSFS_DEPRECATED_V2=y
25CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y
27CONFIG_PRINTK_TIME=y
28
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/PT1-nh b/tools/testing/selftests/rcutorture/configs/v3.3/PT1-nh
new file mode 100644
index 000000000000..e3361c3894a1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/PT1-nh
@@ -0,0 +1,23 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_BOOST=y
3CONFIG_RCU_BOOST_PRIO=2
4CONFIG_RCU_TRACE=y
5CONFIG_RCU_TORTURE_TEST=m
6CONFIG_MODULE_UNLOAD=y
7CONFIG_SUSPEND=n
8CONFIG_HIBERNATION=n
9#
10CONFIG_SMP=n
11#
12CONFIG_HOTPLUG_CPU=n
13#
14CONFIG_NO_HZ=n
15#
16CONFIG_PREEMPT_NONE=n
17CONFIG_PREEMPT_VOLUNTARY=n
18CONFIG_PREEMPT=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/PT2-NH b/tools/testing/selftests/rcutorture/configs/v3.3/PT2-NH
new file mode 100644
index 000000000000..64abfc3b4d94
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/PT2-NH
@@ -0,0 +1,22 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=n
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
new file mode 100644
index 000000000000..c37432f3572c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.3/ver_functions.sh
@@ -0,0 +1,41 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 echo $1
28}
29
30# rcutorture_param_onoff bootparam-string config-file
31#
32# Adds onoff rcutorture module parameters to kernels having it.
33rcutorture_param_onoff () {
34 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
35 then
36 echo CPU-hotplug kernel, adding rcutorture onoff.
37 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
38 else
39 echo $1
40 fi
41}
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST b/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST
new file mode 100644
index 000000000000..18223947bbcb
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/CFLIST
@@ -0,0 +1,14 @@
1P1-S-T-NH-SD-SMP-HP
2P2-2-t-nh-sd-SMP-hp
3P3-3-T-nh-SD-SMP-hp
4P4-A-t-NH-sd-SMP-HP
5P5-U-T-NH-sd-SMP-hp
6N1-S-T-NH-SD-SMP-HP
7N2-2-t-nh-sd-SMP-hp
8N3-3-T-nh-SD-SMP-hp
9N4-A-t-NH-sd-SMP-HP
10N5-U-T-NH-sd-SMP-hp
11PT1-nh
12PT2-NH
13NT1-nh
14NT3-NH
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/N1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.5/N1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..d81e11d280aa
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/N1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,19 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_FAST_NO_HZ=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=8
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=n
8CONFIG_HOTPLUG_CPU=y
9CONFIG_PREEMPT_NONE=y
10CONFIG_PREEMPT_VOLUNTARY=n
11CONFIG_PREEMPT=n
12#CHECK#CONFIG_TREE_RCU=y
13CONFIG_RCU_TORTURE_TEST=m
14CONFIG_MODULE_UNLOAD=y
15CONFIG_SYSFS_DEPRECATED_V2=y
16CONFIG_IKCONFIG=y
17CONFIG_IKCONFIG_PROC=y
18CONFIG_PRINTK_TIME=y
19
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/N2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/N2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..02e418572b1b
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/N2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/N3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/N3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b3100f69c8cf
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/N3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=y
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=n
13#CHECK#CONFIG_TREE_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/N4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.5/N4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..c56b44530725
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/N4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,18 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=y
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=n
11#CHECK#CONFIG_TREE_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_SYSFS_DEPRECATED_V2=y
15CONFIG_IKCONFIG=y
16CONFIG_IKCONFIG_PROC=y
17CONFIG_PRINTK_TIME=y
18
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/N5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/N5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..90d924fea9e9
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/N5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=y
2CONFIG_DEBUG_KERNEL=y
3CONFIG_RCU_CPU_STALL_INFO=y
4CONFIG_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=6
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=y
9CONFIG_HOTPLUG_CPU=n
10CONFIG_SUSPEND=n
11CONFIG_HIBERNATION=n
12CONFIG_PREEMPT_NONE=y
13CONFIG_PREEMPT_VOLUNTARY=n
14CONFIG_PREEMPT=n
15#CHECK#CONFIG_TREE_RCU=y
16CONFIG_RCU_TORTURE_TEST=m
17CONFIG_MODULE_UNLOAD=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/NT1-nh b/tools/testing/selftests/rcutorture/configs/v3.5/NT1-nh
new file mode 100644
index 000000000000..023f312a931c
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/NT1-nh
@@ -0,0 +1,23 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TRACE=y
3CONFIG_RCU_TORTURE_TEST=m
4CONFIG_MODULE_UNLOAD=y
5CONFIG_SUSPEND=n
6CONFIG_HIBERNATION=n
7#
8CONFIG_SMP=n
9#
10CONFIG_HOTPLUG_CPU=n
11#
12CONFIG_NO_HZ=n
13#
14CONFIG_PREEMPT_NONE=y
15CONFIG_PREEMPT_VOLUNTARY=n
16CONFIG_PREEMPT=n
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/NT3-NH b/tools/testing/selftests/rcutorture/configs/v3.5/NT3-NH
new file mode 100644
index 000000000000..6fd0235dae73
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/NT3-NH
@@ -0,0 +1,20 @@
1#CHECK#CONFIG_TINY_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=y
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=n
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/P1-S-T-NH-SD-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.5/P1-S-T-NH-SD-SMP-HP
new file mode 100644
index 000000000000..9647c44cf4b7
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/P1-S-T-NH-SD-SMP-HP
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_RCU_FAST_NO_HZ=y
5CONFIG_SMP=y
6CONFIG_RCU_FANOUT=8
7CONFIG_NR_CPUS=8
8CONFIG_RCU_FANOUT_EXACT=n
9CONFIG_HOTPLUG_CPU=y
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/P2-2-t-nh-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/P2-2-t-nh-sd-SMP-hp
new file mode 100644
index 000000000000..0f3b667d2a9f
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/P2-2-t-nh-sd-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=4
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/P3-3-T-nh-SD-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/P3-3-T-nh-SD-SMP-hp
new file mode 100644
index 000000000000..b035e141bf2a
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/P3-3-T-nh-SD-SMP-hp
@@ -0,0 +1,20 @@
1CONFIG_RCU_TRACE=y
2CONFIG_NO_HZ=n
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=2
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=n
8CONFIG_SUSPEND=n
9CONFIG_HIBERNATION=n
10CONFIG_PREEMPT_NONE=n
11CONFIG_PREEMPT_VOLUNTARY=n
12CONFIG_PREEMPT=y
13#CHECK#CONFIG_TREE_PREEMPT_RCU=y
14CONFIG_RCU_TORTURE_TEST=m
15CONFIG_MODULE_UNLOAD=y
16CONFIG_SYSFS_DEPRECATED_V2=y
17CONFIG_IKCONFIG=y
18CONFIG_IKCONFIG_PROC=y
19CONFIG_PRINTK_TIME=y
20
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/P4-A-t-NH-sd-SMP-HP b/tools/testing/selftests/rcutorture/configs/v3.5/P4-A-t-NH-sd-SMP-HP
new file mode 100644
index 000000000000..3ccf6a9447f5
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/P4-A-t-NH-sd-SMP-HP
@@ -0,0 +1,22 @@
1CONFIG_RCU_TRACE=n
2CONFIG_NO_HZ=y
3CONFIG_SMP=y
4CONFIG_RCU_FANOUT=6
5CONFIG_NR_CPUS=8
6CONFIG_RCU_FANOUT_EXACT=n
7CONFIG_HOTPLUG_CPU=y
8CONFIG_PREEMPT_NONE=n
9CONFIG_PREEMPT_VOLUNTARY=n
10CONFIG_PREEMPT=y
11#CHECK#CONFIG_TREE_PREEMPT_RCU=y
12CONFIG_RCU_TORTURE_TEST=m
13CONFIG_MODULE_UNLOAD=y
14CONFIG_RT_MUTEXES=y
15CONFIG_RCU_BOOST=y
16CONFIG_RCU_BOOST_PRIO=2
17CONFIG_PROVE_LOCKING=y
18CONFIG_PROVE_RCU=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/P5-U-T-NH-sd-SMP-hp b/tools/testing/selftests/rcutorture/configs/v3.5/P5-U-T-NH-sd-SMP-hp
new file mode 100644
index 000000000000..ef624ce73d8e
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/P5-U-T-NH-sd-SMP-hp
@@ -0,0 +1,28 @@
1CONFIG_RCU_TRACE=y
2CONFIG_RCU_CPU_STALL_INFO=y
3CONFIG_NO_HZ=y
4CONFIG_SMP=y
5CONFIG_RCU_FANOUT=6
6CONFIG_NR_CPUS=8
7CONFIG_RCU_FANOUT_EXACT=y
8CONFIG_HOTPLUG_CPU=n
9CONFIG_SUSPEND=n
10CONFIG_HIBERNATION=n
11CONFIG_PREEMPT_NONE=n
12CONFIG_PREEMPT_VOLUNTARY=n
13CONFIG_PREEMPT=y
14#CHECK#CONFIG_TREE_PREEMPT_RCU=y
15CONFIG_DEBUG_KERNEL=y
16CONFIG_PROVE_RCU_DELAY=y
17CONFIG_DEBUG_OBJECTS=y
18CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
19CONFIG_RT_MUTEXES=y
20CONFIG_RCU_BOOST=y
21CONFIG_RCU_BOOST_PRIO=2
22CONFIG_RCU_TORTURE_TEST=m
23CONFIG_MODULE_UNLOAD=y
24CONFIG_SYSFS_DEPRECATED_V2=y
25CONFIG_IKCONFIG=y
26CONFIG_IKCONFIG_PROC=y
27CONFIG_PRINTK_TIME=y
28
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/PT1-nh b/tools/testing/selftests/rcutorture/configs/v3.5/PT1-nh
new file mode 100644
index 000000000000..e3361c3894a1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/PT1-nh
@@ -0,0 +1,23 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_BOOST=y
3CONFIG_RCU_BOOST_PRIO=2
4CONFIG_RCU_TRACE=y
5CONFIG_RCU_TORTURE_TEST=m
6CONFIG_MODULE_UNLOAD=y
7CONFIG_SUSPEND=n
8CONFIG_HIBERNATION=n
9#
10CONFIG_SMP=n
11#
12CONFIG_HOTPLUG_CPU=n
13#
14CONFIG_NO_HZ=n
15#
16CONFIG_PREEMPT_NONE=n
17CONFIG_PREEMPT_VOLUNTARY=n
18CONFIG_PREEMPT=y
19CONFIG_SYSFS_DEPRECATED_V2=y
20CONFIG_IKCONFIG=y
21CONFIG_IKCONFIG_PROC=y
22CONFIG_PRINTK_TIME=y
23
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/PT2-NH b/tools/testing/selftests/rcutorture/configs/v3.5/PT2-NH
new file mode 100644
index 000000000000..64abfc3b4d94
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/PT2-NH
@@ -0,0 +1,22 @@
1CONFIG_TINY_PREEMPT_RCU=y
2CONFIG_RCU_TORTURE_TEST=m
3CONFIG_MODULE_UNLOAD=y
4CONFIG_SUSPEND=n
5CONFIG_HIBERNATION=n
6#
7CONFIG_SMP=n
8#
9CONFIG_HOTPLUG_CPU=n
10#
11CONFIG_NO_HZ=y
12#
13CONFIG_PREEMPT_NONE=n
14CONFIG_PREEMPT_VOLUNTARY=n
15CONFIG_PREEMPT=y
16CONFIG_PROVE_LOCKING=y
17CONFIG_PROVE_RCU=y
18CONFIG_SYSFS_DEPRECATED_V2=y
19CONFIG_IKCONFIG=y
20CONFIG_IKCONFIG_PROC=y
21CONFIG_PRINTK_TIME=y
22
diff --git a/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
new file mode 100644
index 000000000000..6a5f13aab44d
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/v3.5/ver_functions.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
28 then
29 echo $1
30 else
31 echo $1 rcutorture.n_barrier_cbs=4
32 fi
33}
34
35# rcutorture_param_onoff bootparam-string config-file
36#
37# Adds onoff rcutorture module parameters to kernels having it.
38rcutorture_param_onoff () {
39 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
40 then
41 echo CPU-hotplug kernel, adding rcutorture onoff.
42 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
43 else
44 echo $1
45 fi
46}
diff --git a/tools/testing/selftests/rcutorture/configs/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
new file mode 100644
index 000000000000..5e40eadea777
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/configs/ver_functions.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2#
3# Kernel-version-dependent shell functions for the rest of the scripts.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19# Copyright (C) IBM Corporation, 2013
20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22
23# rcutorture_param_n_barrier_cbs bootparam-string
24#
25# Adds n_barrier_cbs rcutorture module parameter to kernels having it.
26rcutorture_param_n_barrier_cbs () {
27 if echo $1 | grep -q "rcutorture\.n_barrier_cbs"
28 then
29 echo $1
30 else
31 echo $1 rcutorture.n_barrier_cbs=4
32 fi
33}
34
35# rcutorture_param_onoff bootparam-string config-file
36#
37# Adds onoff rcutorture module parameters to kernels having it.
38rcutorture_param_onoff () {
39 if ! bootparam_hotplug_cpu "$1" && configfrag_hotplug_cpu "$2"
40 then
41 echo CPU-hotplug kernel, adding rcutorture onoff. 1>&2
42 echo $1 rcutorture.onoff_interval=3 rcutorture.onoff_holdoff=30
43 else
44 echo $1
45 fi
46}
diff --git a/tools/testing/selftests/rcutorture/doc/TINY_RCU.txt b/tools/testing/selftests/rcutorture/doc/TINY_RCU.txt
new file mode 100644
index 000000000000..28db67b54e55
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/doc/TINY_RCU.txt
@@ -0,0 +1,40 @@
1This document gives a brief rationale for the TINY_RCU test cases.
2
3
4Kconfig Parameters:
5
6CONFIG_DEBUG_LOCK_ALLOC -- Do all three and none of the three.
7CONFIG_PREEMPT_COUNT
8CONFIG_RCU_TRACE
9
10The theory here is that randconfig testing will hit the other six possible
11combinations of these parameters.
12
13
14Kconfig Parameters Ignored:
15
16CONFIG_DEBUG_OBJECTS_RCU_HEAD
17CONFIG_PROVE_RCU
18
19 In common code tested by TREE_RCU test cases.
20
21CONFIG_NO_HZ_FULL_SYSIDLE
22CONFIG_RCU_NOCB_CPU
23CONFIG_RCU_USER_QS
24
25 Meaningless for TINY_RCU.
26
27CONFIG_RCU_STALL_COMMON
28CONFIG_RCU_TORTURE_TEST
29
30 Redundant with CONFIG_RCU_TRACE.
31
32CONFIG_HOTPLUG_CPU
33CONFIG_PREEMPT
34CONFIG_PREEMPT_RCU
35CONFIG_SMP
36CONFIG_TINY_RCU
37CONFIG_TREE_PREEMPT_RCU
38CONFIG_TREE_RCU
39
40 All forced by CONFIG_TINY_RCU.
diff --git a/tools/testing/selftests/rcutorture/doc/TREE_RCU-Kconfig.txt b/tools/testing/selftests/rcutorture/doc/TREE_RCU-Kconfig.txt
new file mode 100644
index 000000000000..adbb76cffb49
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/doc/TREE_RCU-Kconfig.txt
@@ -0,0 +1,95 @@
1This document gives a brief rationale for the TREE_RCU-related test
2cases, a group that includes TREE_PREEMPT_RCU.
3
4
5Kconfig Parameters:
6
7CONFIG_DEBUG_LOCK_ALLOC -- Do three, covering CONFIG_PROVE_LOCKING & not.
8CONFIG_DEBUG_OBJECTS_RCU_HEAD -- Do one.
9CONFIG_HOTPLUG_CPU -- Do half. (Every second.)
10CONFIG_HZ_PERIODIC -- Do one.
11CONFIG_NO_HZ_IDLE -- Do those not otherwise specified. (Groups of two.)
12CONFIG_NO_HZ_FULL -- Do two, one with CONFIG_NO_HZ_FULL_SYSIDLE.
13CONFIG_NO_HZ_FULL_SYSIDLE -- Do one.
14CONFIG_PREEMPT -- Do half. (First three and #8.)
15CONFIG_PROVE_LOCKING -- Do all but two, covering CONFIG_PROVE_RCU and not.
16CONFIG_PROVE_RCU -- Do all but one under CONFIG_PROVE_LOCKING.
17CONFIG_PROVE_RCU_DELAY -- Do one.
18CONFIG_RCU_BOOST -- one of TREE_PREEMPT_RCU.
19CONFIG_RCU_BOOST_PRIO -- set to 2 for _BOOST testing.
20CONFIG_RCU_CPU_STALL_INFO -- do one with and without _VERBOSE.
21CONFIG_RCU_CPU_STALL_VERBOSE -- do one with and without _INFO.
22CONFIG_RCU_FANOUT -- Cover hierarchy as currently, but overlap with others.
23CONFIG_RCU_FANOUT_EXACT -- Do one.
24CONFIG_RCU_FANOUT_LEAF -- Do one non-default.
25CONFIG_RCU_FAST_NO_HZ -- Do one, but not with CONFIG_RCU_NOCB_CPU_ALL.
26CONFIG_RCU_NOCB_CPU -- Do three, see below.
27CONFIG_RCU_NOCB_CPU_ALL -- Do one.
28CONFIG_RCU_NOCB_CPU_NONE -- Do one.
29CONFIG_RCU_NOCB_CPU_ZERO -- Do one.
30CONFIG_RCU_TRACE -- Do half.
31CONFIG_SMP -- Need one !SMP for TREE_PREEMPT_RCU.
32RCU-bh: Do one with PREEMPT and one with !PREEMPT.
33RCU-sched: Do one with PREEMPT but not BOOST.
34
35
36Hierarchy:
37
38TREE01. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=8, CONFIG_RCU_FANOUT_EXACT=n.
39TREE02. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=3, CONFIG_RCU_FANOUT_EXACT=n,
40 CONFIG_RCU_FANOUT_LEAF=3.
41TREE03. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=4, CONFIG_RCU_FANOUT_EXACT=n,
42 CONFIG_RCU_FANOUT_LEAF=4.
43TREE04. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=2, CONFIG_RCU_FANOUT_EXACT=n,
44 CONFIG_RCU_FANOUT_LEAF=2.
45TREE05. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=6, CONFIG_RCU_FANOUT_EXACT=n
46 CONFIG_RCU_FANOUT_LEAF=6.
47TREE06. CONFIG_NR_CPUS=8, CONFIG_RCU_FANOUT=6, CONFIG_RCU_FANOUT_EXACT=y
48 CONFIG_RCU_FANOUT_LEAF=6.
49TREE07. CONFIG_NR_CPUS=16, CONFIG_RCU_FANOUT=2, CONFIG_RCU_FANOUT_EXACT=n,
50 CONFIG_RCU_FANOUT_LEAF=2.
51TREE08. CONFIG_NR_CPUS=16, CONFIG_RCU_FANOUT=3, CONFIG_RCU_FANOUT_EXACT=y,
52 CONFIG_RCU_FANOUT_LEAF=2.
53TREE09. CONFIG_NR_CPUS=1.
54
55
56Kconfig Parameters Ignored:
57
58CONFIG_64BIT
59
60 Used only to check CONFIG_RCU_FANOUT value, inspection suffices.
61
62CONFIG_NO_HZ_FULL_SYSIDLE_SMALL
63
64 Defer until Frederic uses this.
65
66CONFIG_PREEMPT_COUNT
67CONFIG_PREEMPT_RCU
68
69 Redundant with CONFIG_PREEMPT, ignore.
70
71CONFIG_RCU_BOOST_DELAY
72
73 Inspection suffices, ignore.
74
75CONFIG_RCU_CPU_STALL_TIMEOUT
76
77 Inspection suffices, ignore.
78
79CONFIG_RCU_STALL_COMMON
80
81 Implied by TREE_RCU and TREE_PREEMPT_RCU.
82
83CONFIG_RCU_TORTURE_TEST
84CONFIG_RCU_TORTURE_TEST_RUNNABLE
85
86 Always used in KVM testing.
87
88CONFIG_RCU_USER_QS
89
90 Redundant with CONFIG_NO_HZ_FULL.
91
92CONFIG_TREE_PREEMPT_RCU
93CONFIG_TREE_RCU
94
95 These are controlled by CONFIG_PREEMPT.
diff --git a/tools/testing/selftests/rcutorture/doc/initrd.txt b/tools/testing/selftests/rcutorture/doc/initrd.txt
new file mode 100644
index 000000000000..49d134c25c04
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/doc/initrd.txt
@@ -0,0 +1,90 @@
1This document describes one way to create the initrd directory hierarchy
2in order to allow an initrd to be built into your kernel. The trick
3here is to steal the initrd file used on your Linux laptop, Ubuntu in
4this case. There are probably much better ways of doing this.
5
6That said, here are the commands:
7
8------------------------------------------------------------------------
9zcat /initrd.img > /tmp/initrd.img.zcat
10mkdir initrd
11cd initrd
12cpio -id < /tmp/initrd.img.zcat
13------------------------------------------------------------------------
14
15Interestingly enough, if you are running rcutorture, you don't really
16need userspace in many cases. Running without userspace has the
17advantage of allowing you to test your kernel independently of the
18distro in place, the root-filesystem layout, and so on. To make this
19happen, put the following script in the initrd's tree's "/init" file,
20with 0755 mode.
21
22------------------------------------------------------------------------
23#!/bin/sh
24
25[ -d /dev ] || mkdir -m 0755 /dev
26[ -d /root ] || mkdir -m 0700 /root
27[ -d /sys ] || mkdir /sys
28[ -d /proc ] || mkdir /proc
29[ -d /tmp ] || mkdir /tmp
30mkdir -p /var/lock
31mount -t sysfs -o nodev,noexec,nosuid sysfs /sys
32mount -t proc -o nodev,noexec,nosuid proc /proc
33# Some things don't work properly without /etc/mtab.
34ln -sf /proc/mounts /etc/mtab
35
36# Note that this only becomes /dev on the real filesystem if udev's scripts
37# are used; which they will be, but it's worth pointing out
38if ! mount -t devtmpfs -o mode=0755 udev /dev; then
39 echo "W: devtmpfs not available, falling back to tmpfs for /dev"
40 mount -t tmpfs -o mode=0755 udev /dev
41 [ -e /dev/console ] || mknod --mode=600 /dev/console c 5 1
42 [ -e /dev/kmsg ] || mknod --mode=644 /dev/kmsg c 1 11
43 [ -e /dev/null ] || mknod --mode=666 /dev/null c 1 3
44fi
45
46mkdir /dev/pts
47mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true
48mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
49mkdir /run/initramfs
50# compatibility symlink for the pre-oneiric locations
51ln -s /run/initramfs /dev/.initramfs
52
53# Export relevant variables
54export ROOT=
55export ROOTDELAY=
56export ROOTFLAGS=
57export ROOTFSTYPE=
58export IP=
59export BOOT=
60export BOOTIF=
61export UBIMTD=
62export break=
63export init=/sbin/init
64export quiet=n
65export readonly=y
66export rootmnt=/root
67export debug=
68export panic=
69export blacklist=
70export resume=
71export resume_offset=
72export recovery=
73
74for i in /sys/devices/system/cpu/cpu*/online
75do
76 case $i in
77 '/sys/devices/system/cpu/cpu0/online')
78 ;;
79 '/sys/devices/system/cpu/cpu*/online')
80 ;;
81 *)
82 echo 1 > $i
83 ;;
84 esac
85done
86
87while :
88do
89 sleep 10
90done
diff --git a/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt b/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt
new file mode 100644
index 000000000000..66efb59a1bd1
--- /dev/null
+++ b/tools/testing/selftests/rcutorture/doc/rcu-test-image.txt
@@ -0,0 +1,42 @@
1This document describes one way to created the rcu-test-image file
2that contains the filesystem used by the guest-OS kernel. There are
3probably much better ways of doing this, and this filesystem could no
4doubt be smaller. It is probably also possible to simply download
5an appropriate image from any number of places.
6
7That said, here are the commands:
8
9------------------------------------------------------------------------
10dd if=/dev/zero of=rcu-test-image bs=400M count=1
11mkfs.ext3 ./rcu-test-image
12sudo mount -o loop ./rcu-test-image /mnt
13
14# Replace "precise" below with your favorite Ubuntu release.
15# Empirical evidence says this image will work for 64-bit, but...
16# Note that debootstrap does take a few minutes to run. Or longer.
17sudo debootstrap --verbose --arch i386 precise /mnt http://archive.ubuntu.com/ubuntu
18cat << '___EOF___' | sudo dd of=/mnt/etc/fstab
19# UNCONFIGURED FSTAB FOR BASE SYSTEM
20#
21/dev/vda / ext3 defaults 1 1
22dev /dev tmpfs rw 0 0
23tmpfs /dev/shm tmpfs defaults 0 0
24devpts /dev/pts devpts gid=5,mode=620 0 0
25sysfs /sys sysfs defaults 0 0
26proc /proc proc defaults 0 0
27___EOF___
28sudo umount /mnt
29------------------------------------------------------------------------
30
31
32References:
33
34 http://sripathikodi.blogspot.com/2010/02/creating-kvm-bootable-fedora-system.html
35 https://help.ubuntu.com/community/KVM/CreateGuests
36 https://help.ubuntu.com/community/JeOSVMBuilder
37 http://wiki.libvirt.org/page/UbuntuKVMWalkthrough
38 http://www.moe.co.uk/2011/01/07/pci_add_option_rom-failed-to-find-romfile-pxe-rtl8139-bin/ -- "apt-get install kvm-pxe"
39 http://www.landley.net/writing/rootfs-howto.html
40 http://en.wikipedia.org/wiki/Initrd
41 http://en.wikipedia.org/wiki/Cpio
42 http://wiki.libvirt.org/page/UbuntuKVMWalkthrough