Torture-test changes for 4.11
Subsystems (3)
cover Torture-test changes for 4.11
Hello!
This series provides torture-test updates:
1. Add a check for CONFIG_RCU_STALL_COMMON for TINY01, in order
to complain if this case is not tested.
2. Add CONFIG_PROVE_RCU_REPEATEDLY=y for TINY02, in order to test
this case.
3. Add tests without slow grace period setup/cleanup, as this case
is what is actually used in production.
4. Run at least one test with CONFIG_DEBUG_OBJECTS_RCU_HEAD, to make
sure that this case is tested regularly.
5. Run one test with DEBUG_LOCK_ALLOC but not PROVE_LOCKING, to make
sure that this case is tested regularly.
6. Run a couple scenarios with CONFIG_RCU_EQS_DEBUG, again to make
sure that this case is tested regularly.
7. Update RCU test scenario documentation.
8. Fix potential memory leak with rw lock test, courtesy of Yang Shi.
9. Enable DEBUG_OBJECTS_RCU_HEAD for Tiny RCU, you guessed it, to
make sure that this case is regularly tested.
Thanx, Paul
------------------------------------------------------------------------
kernel/locking/locktorture.c | 6 ++ tools/testing/selftests/rcutorture/configs/rcu/CFcommon | 3 - tools/testing/selftests/rcutorture/configs/rcu/TINY01 | 1 tools/testing/selftests/rcutorture/configs/rcu/TINY02 | 3 - tools/testing/selftests/rcutorture/configs/rcu/TREE01 | 3 + tools/testing/selftests/rcutorture/configs/rcu/TREE02 | 4 + tools/testing/selftests/rcutorture/configs/rcu/TREE03 | 3 + tools/testing/selftests/rcutorture/configs/rcu/TREE04 | 4 + tools/testing/selftests/rcutorture/configs/rcu/TREE05 | 3 + tools/testing/selftests/rcutorture/configs/rcu/TREE06 | 3 + tools/testing/selftests/rcutorture/configs/rcu/TREE07 | 3 + tools/testing/selftests/rcutorture/configs/rcu/TREE08 | 4 - tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt | 33 +++++++++++- 13 files changed, 65 insertions(+), 8 deletions(-)
PATCH 1/9 torture: Add a check for CONFIG_RCU_STALL_COMMON for TINY01
This commit verifies coverage of testing with CONFIG_RCU_STALL_COMMON=n.
--- tools/testing/selftests/rcutorture/configs/rcu/TINY01 | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/rcutorture/configs/rcu/TINY01 +1 -0
@@ -7,6 +7,7 @@ CONFIG_HZ_PERIODIC=n CONFIG_NO_HZ_IDLE=y CONFIG_NO_HZ_FULL=n CONFIG_RCU_TRACE=n +#CHECK#CONFIG_RCU_STALL_COMMON=n CONFIG_DEBUG_LOCK_ALLOC=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_PREEMPT_COUNT=n
Signature · 1 line
2.5.2
PATCH 2/9 torture: Add CONFIG_PROVE_RCU_REPEATEDLY=y for TINY02
In reply to Paul E. McKenneyThis commit adds CONFIG_PROVE_RCU_REPEATEDLY=y, which has been untested for quite some time.
--- tools/testing/selftests/rcutorture/configs/rcu/TINY02 | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/rcutorture/configs/rcu/TINY02 +1 -0
@@ -8,6 +8,7 @@ CONFIG_NO_HZ_IDLE=n CONFIG_NO_HZ_FULL=n CONFIG_RCU_TRACE=y CONFIG_PROVE_LOCKING=y +CONFIG_PROVE_RCU_REPEATEDLY=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_DEBUG_LOCK_ALLOC=y CONFIG_DEBUG_OBJECTS_RCU_HEAD=n
Signature · 1 line
2.5.2
PATCH 3/9 torture: Add tests without slow grace period setup/cleanup
In reply to Paul E. McKenneyThis commit moves CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP, CONFIG_RCU_TORTURE_TEST_SLOW_INIT, and CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT from CFcommon to all of the TREE scenarios other than TREE08 and TREE09 in order to do at least some testing without these Kconfig options set.
--- tools/testing/selftests/rcutorture/configs/rcu/CFcommon | 3 --- tools/testing/selftests/rcutorture/configs/rcu/TREE01 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE02 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE03 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE04 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE05 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE06 | 3 +++ tools/testing/selftests/rcutorture/configs/rcu/TREE07 | 3 +++ 8 files changed, 21 insertions(+), 3 deletions(-)
tools/testing/selftests/rcutorture/configs/rcu/CFcommon +0 -3
@@ -1,5 +1,2 @@ CONFIG_RCU_TORTURE_TEST=y CONFIG_PRINTK_TIME=y -CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y -CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y -CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE01 +3 -0
@@ -16,3 +16,6 @@ CONFIG_DEBUG_LOCK_ALLOC=n CONFIG_RCU_BOOST=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE02 +3 -0
@@ -20,3 +20,6 @@ CONFIG_PROVE_LOCKING=n CONFIG_RCU_BOOST=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE03 +3 -0
@@ -17,3 +17,6 @@ CONFIG_RCU_BOOST=y CONFIG_RCU_KTHREAD_PRIO=2 CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE04 +3 -0
@@ -19,3 +19,6 @@ CONFIG_RCU_NOCB_CPU=n CONFIG_DEBUG_LOCK_ALLOC=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE05 +3 -0
@@ -19,3 +19,6 @@ CONFIG_PROVE_LOCKING=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE06 +3 -0
@@ -20,3 +20,6 @@ CONFIG_PROVE_LOCKING=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_DEBUG_OBJECTS_RCU_HEAD=y CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
tools/testing/selftests/rcutorture/configs/rcu/TREE07 +3 -0
@@ -19,3 +19,6 @@ CONFIG_RCU_NOCB_CPU=n CONFIG_DEBUG_LOCK_ALLOC=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y +CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y
Signature · 1 line
2.5.2
PATCH 4/9 torture: Run at least one test with CONFIG_DEBUG_OBJECTS_RCU_HEAD
In reply to Paul E. McKenneyThis commit enables the CONFIG_DEBUG_OBJECTS_RCU_HEAD Kconfig option in TREE02 in order to do at least some testing with this enabled.
--- tools/testing/selftests/rcutorture/configs/rcu/TREE02 | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/rcutorture/configs/rcu/TREE02 +1 -0
@@ -23,3 +23,4 @@ CONFIG_RCU_EXPERT=y CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y +CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
Signature · 1 line
2.5.2
PATCH 5/9 torture: Run one test with DEBUG_LOCK_ALLOC but not PROVE_LOCKING
In reply to Paul E. McKenneyThis commit sets CONFIG_DEBUG_LOCK_ALLOC but not CONFIG_PROVE_LOCKING for TREE08 in order to have at least one test with this configuration.
--- tools/testing/selftests/rcutorture/configs/rcu/TREE08 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/rcutorture/configs/rcu/TREE08 +1 -2
@@ -17,8 +17,7 @@ CONFIG_RCU_FANOUT_LEAF=2 CONFIG_RCU_NOCB_CPU=y CONFIG_RCU_NOCB_CPU_ALL=y CONFIG_DEBUG_LOCK_ALLOC=n -CONFIG_PROVE_LOCKING=y -#CHECK#CONFIG_PROVE_RCU=y +CONFIG_PROVE_LOCKING=n CONFIG_RCU_BOOST=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y
Signature · 1 line
2.5.2
PATCH 6/9 torture: Run a couple scenarios with CONFIG_RCU_EQS_DEBUG
In reply to Paul E. McKenneyThis commit runs TREE04 and TREE08 with CONFIG_RCU_EQS_DEBUG=y, enabling dyntick-counter checking on those two tests.
--- tools/testing/selftests/rcutorture/configs/rcu/TREE04 | 1 + tools/testing/selftests/rcutorture/configs/rcu/TREE08 | 1 + 2 files changed, 2 insertions(+)
tools/testing/selftests/rcutorture/configs/rcu/TREE04 +1 -0
@@ -22,3 +22,4 @@ CONFIG_RCU_EXPERT=y CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP=y CONFIG_RCU_TORTURE_TEST_SLOW_INIT=y CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT=y +CONFIG_RCU_EQS_DEBUG=y
tools/testing/selftests/rcutorture/configs/rcu/TREE08 +1 -0
@@ -21,3 +21,4 @@ CONFIG_PROVE_LOCKING=n CONFIG_RCU_BOOST=n CONFIG_DEBUG_OBJECTS_RCU_HEAD=n CONFIG_RCU_EXPERT=y +CONFIG_RCU_EQS_DEBUG=y
Signature · 1 line
2.5.2
PATCH 7/9 torture: Update RCU test scenario documentation
In reply to Paul E. McKenney--- .../selftests/rcutorture/doc/TREE_RCU-kconfig.txt | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)
tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt +31 -2
@@ -14,6 +14,7 @@ CONFIG_NO_HZ_FULL_SYSIDLE -- Do one. CONFIG_PREEMPT -- Do half. (First three and #8.) CONFIG_PROVE_LOCKING -- Do several, covering CONFIG_DEBUG_LOCK_ALLOC=y and not. CONFIG_PROVE_RCU -- Hardwired to CONFIG_PROVE_LOCKING. +CONFIG_PROVE_RCU_REPEATEDLY -- Do one. CONFIG_RCU_BOOST -- one of PREEMPT_RCU. CONFIG_RCU_KTHREAD_PRIO -- set to 2 for _BOOST testing. CONFIG_RCU_FANOUT -- Cover hierarchy, but overlap with others.
@@ -25,7 +26,12 @@ CONFIG_RCU_NOCB_CPU_NONE -- Do one. CONFIG_RCU_NOCB_CPU_ZERO -- Do one. CONFIG_RCU_TRACE -- Do half. CONFIG_SMP -- Need one !SMP for PREEMPT_RCU. -!RCU_EXPERT -- Do a few, but these have to be vanilla configurations. +CONFIG_RCU_EXPERT=n -- Do a few, but these have to be vanilla configurations. +CONFIG_RCU_EQS_DEBUG -- Do at least one for CONFIG_NO_HZ_FULL and not. +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP -- Do for all but a couple TREE scenarios. +CONFIG_RCU_TORTURE_TEST_SLOW_INIT -- Do for all but a couple TREE scenarios. +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT -- Do for all but a couple TREE scenarios. + RCU-bh: Do one with PREEMPT and one with !PREEMPT. RCU-sched: Do one with PREEMPT but not BOOST.
@@ -72,7 +78,30 @@ CONFIG_RCU_TORTURE_TEST_RUNNABLE Always used in KVM testing. +CONFIG_RCU_TORTURE_TEST_SLOW_PREINIT_DELAY +CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY +CONFIG_RCU_TORTURE_TEST_SLOW_CLEANUP_DELAY + + Inspection suffices, ignore. + CONFIG_PREEMPT_RCU CONFIG_TREE_RCU +CONFIG_TINY_RCU + + These are controlled by CONFIG_PREEMPT and/or CONFIG_SMP. + +CONFIG_SPARSE_RCU_POINTER + + Makes sense only for sparse runs, not for kernel builds. + +CONFIG_SRCU +CONFIG_TASKS_RCU + + Selected by CONFIG_RCU_TORTURE_TEST, so cannot disable. + +CONFIG_RCU_TRACE + + Implied by CONFIG_RCU_TRACE for Tree RCU. + - These are controlled by CONFIG_PREEMPT. +boot parameters ignored: TBD
Signature · 1 line
2.5.2
PATCH 8/9 locktorture: Fix potential memory leak with rw lock test
In reply to Paul E. McKenneyFrom: Yang Shi <[email protected]>
When running locktorture module with the below commands with kmemleak enabled:
$ modprobe locktorture torture_type=rw_lock_irq $ rmmod locktorture
The below kmemleak got caught:
root@10:~# echo scan > /sys/kernel/debug/kmemleak
[ 323.197029] kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
root@10:~# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffffffc07592d500 (size 128):
comm "modprobe", pid 368, jiffies 4294924118 (age 205.824s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 c3 7b 02 00 00 00 00 00 .........{......
00 00 00 00 00 00 00 00 d7 9b 02 00 00 00 00 00 ................
backtrace:
[<ffffff80081e5a88>] create_object+0x110/0x288
[<ffffff80086c6078>] kmemleak_alloc+0x58/0xa0
[<ffffff80081d5acc>] __kmalloc+0x234/0x318
[<ffffff80006fa130>] 0xffffff80006fa130
[<ffffff8008083ae4>] do_one_initcall+0x44/0x138
[<ffffff800817e28c>] do_init_module+0x68/0x1cc
[<ffffff800811c848>] load_module+0x1a68/0x22e0
[<ffffff800811d340>] SyS_finit_module+0xe0/0xf0
[<ffffff80080836f0>] el0_svc_naked+0x24/0x28
[<ffffffffffffffff>] 0xffffffffffffffff
unreferenced object 0xffffffc07592d480 (size 128):
comm "modprobe", pid 368, jiffies 4294924118 (age 205.824s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 3b 6f 01 00 00 00 00 00 ........;o......
00 00 00 00 00 00 00 00 23 6a 01 00 00 00 00 00 ........#j......
backtrace:
[<ffffff80081e5a88>] create_object+0x110/0x288
[<ffffff80086c6078>] kmemleak_alloc+0x58/0xa0
[<ffffff80081d5acc>] __kmalloc+0x234/0x318
[<ffffff80006fa22c>] 0xffffff80006fa22c
[<ffffff8008083ae4>] do_one_initcall+0x44/0x138
[<ffffff800817e28c>] do_init_module+0x68/0x1cc
[<ffffff800811c848>] load_module+0x1a68/0x22e0
[<ffffff800811d340>] SyS_finit_module+0xe0/0xf0
[<ffffff80080836f0>] el0_svc_naked+0x24/0x28
[<ffffffffffffffff>] 0xffffffffffffffffIt is because cxt.lwsa and cxt.lrsa don't get freed in module_exit, so free them in lock_torture_cleanup() and free writer_tasks if reader_tasks is failed at memory allocation.
--- kernel/locking/locktorture.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/locking/locktorture.c +6 -0
@@ -780,6 +780,10 @@ static void lock_torture_cleanup(void)else lock_torture_print_module_parms (cxt.cur_ops,"End of test: SUCCESS" ); + +kfree (cxt.lwsa); +kfree (cxt.lrsa); + end:torture_cleanup_end (); }
@@ -924,6 +928,8 @@ static int __init lock_torture_init(void) GFP_KERNEL);if (reader_tasks ==NULL ) {VERBOSE_TOROUT_ERRSTRING ("reader_tasks: Out of memory" ); +kfree (writer_tasks); + writer_tasks =NULL ; firsterr = -ENOMEM ; goto unwind; }
Signature · 1 line
2.5.2
PATCH 9/9 torture: Enable DEBUG_OBJECTS_RCU_HEAD for Tiny RCU
In reply to Paul E. McKenneyThe RCU torture tests currently do not run any Tiny RCU scenarios for CONFIG_DEBUG_OBJECTS_RCU_HEAD=y. This is a hole in the test, given that someone might need this in real life and given that Tiny RCU uses different callback-handling code than does Tree RCU. This commit therefore enables this Kconfig option for scenario TINY02.
--- tools/testing/selftests/rcutorture/configs/rcu/TINY02 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/rcutorture/configs/rcu/TINY02 +1 -1
@@ -11,5 +11,5 @@ CONFIG_PROVE_LOCKING=y CONFIG_PROVE_RCU_REPEATEDLY=y #CHECK#CONFIG_PROVE_RCU=y CONFIG_DEBUG_LOCK_ALLOC=y -CONFIG_DEBUG_OBJECTS_RCU_HEAD=n +CONFIG_DEBUG_OBJECTS_RCU_HEAD=y CONFIG_PREEMPT_COUNT=y
Signature · 1 line
2.5.2
Quoted 22 lines · Paul E. McKenney
Hello!
This series provides torture-test updates:
1. Add a check for
CONFIG_RCU_STALL_COMMONfor TINY01, in order
to complain if this case is not tested.2. Add
CONFIG_PROVE_RCU_REPEATEDLY=yfor TINY02, in order to test
this case.3. Add tests without slow grace period setup/cleanup, as this case
is what is actually used in production.4. Run at least one test with
CONFIG_DEBUG_OBJECTS_RCU_HEAD, to make
sure that this case is tested regularly.5. Run one test with
DEBUG_LOCK_ALLOCbut notPROVE_LOCKING, to make
sure that this case is tested regularly.6. Run a couple scenarios with
CONFIG_RCU_EQS_DEBUG, again to make
sure that this case is tested regularly.
Quoted 6 lines
7. Update RCU test scenario documentation.
8. Fix potential memory leak with rw lock test, courtesy of Yang Shi.
9. Enable
DEBUG_OBJECTS_RCU_HEADfor Tiny RCU, you guessed it, to
make sure that this case is regularly tested.
Paul E. McKenney
AppliedQuoted 23 lines · Josh Triplett
Quoted 22 lines · Paul E. McKenney
Hello!
This series provides torture-test updates:
1. Add a check for
CONFIG_RCU_STALL_COMMONfor TINY01, in order
to complain if this case is not tested.2. Add
CONFIG_PROVE_RCU_REPEATEDLY=yfor TINY02, in order to test
this case.3. Add tests without slow grace period setup/cleanup, as this case
is what is actually used in production.4. Run at least one test with
CONFIG_DEBUG_OBJECTS_RCU_HEAD, to make
sure that this case is tested regularly.5. Run one test with
DEBUG_LOCK_ALLOCbut notPROVE_LOCKING, to make
sure that this case is tested regularly.6. Run a couple scenarios with
CONFIG_RCU_EQS_DEBUG, again to make
sure that this case is tested regularly.
Quoted 8 lines
Quoted 6 lines
7. Update RCU test scenario documentation.
8. Fix potential memory leak with rw lock test, courtesy of Yang Shi.
9. Enable
DEBUG_OBJECTS_RCU_HEADfor Tiny RCU, you guessed it, to
make sure that this case is regularly tested.Reviewed-by Josh Triplett <[email protected]>
Applied, thank you!
Thanx, Paul