torture-test changes for 4.4
Subsystems (4)
cover torture-test changes for 4.4
Hello!
This series contains torture-test changes:
1. Fix module unwind when bad torture_type specified to rcutorture.
2. Fix unused-function warning for torturing_tasks().
3. Forgive non-plural arguments.
4. Fix module unwind when bad torture_type specified to locktorture.
Thanx, Paul
------------------------------------------------------------------------
b/kernel/locking/locktorture.c | 6 +++--- b/kernel/rcu/rcutorture.c | 8 ++++---- b/tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-)
PATCH 4/4 locktorture: Fix module unwind when bad torture_type specified
In reply to Paul E. McKenneyThe locktorture module has a list of torture types, and specifying a type not on this list is supposed to cleanly fail the module load. Unfortunately, the "fail" happens without the "cleanly". This commit therefore adds the needed clean-up after an incorrect torture_type.
--- kernel/locking/locktorture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/locking/locktorture.c +3 -3
@@ -661,11 +661,11 @@ static int __init lock_torture_init(void)for (i =0 ; i <ARRAY_SIZE (torture_ops); i++)pr_alert (" %s" , torture_ops[i]->name);pr_alert ("\n" ); -torture_init_end (); -return -EINVAL ; + firsterr = -EINVAL ; + goto unwind; }if (cxt.cur_ops->init) - cxt.cur_ops->init ();/* no "goto unwind" prior to this point!!! */ + cxt.cur_ops->init ();if (nwriters_stress >=0 ) cxt.nrealwriters_stress = nwriters_stress;
Signature · 1 line
2.5.2
PATCH 3/4 torture: Forgive non-plural arguments
In reply to Paul E. McKenneyThis commit allows --bootarg instead of --bootargs, --config instead of --configs, and --qemu-arg instead of --qemu-args. For those cases where a native English speaker might auto-correct the argument to be incorrect.
--- tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/rcutorture/bin/kvm.sh +3 -3
@@ -75,7 +75,7 @@ usage () { while test $# -gt 0 do case "$1" in - --bootargs) + --bootargs|--bootarg) checkarg --bootargs "(list of kernel boot arguments)" "$#" "$2" '.*' '^--' TORTURE_BOOTARGS="$2" shift
@@ -88,7 +88,7 @@ do --buildonly) TORTURE_BUILDONLY=1 ;; - --configs) + --configs|--config) checkarg --configs "(list of config files)" "$#" "$2" '^[^/]*$' '^--' configs="$2" shift
@@ -134,7 +134,7 @@ do --no-initrd) TORTURE_INITRD=""; export TORTURE_INITRD ;; - --qemu-args) + --qemu-args|--qemu-arg) checkarg --qemu-args "-qemu args" $# "$2" '^-' '^error' TORTURE_QEMU_ARG="$2" shift
Signature · 1 line
2.5.2
PATCH 1/4 rcutorture: Fix module unwind when bad torture_type specified
In reply to Paul E. McKenneyThe rcutorture module has a list of torture types, and specifying a type not on this list is supposed to cleanly fail the module load. Unfortunately, the "fail" happens without the "cleanly". This commit therefore adds the needed clean-up after an incorrect torture_type.
--- kernel/rcu/rcutorture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/rcu/rcutorture.c +3 -3
@@ -1742,15 +1742,15 @@ rcu_torture_init(void)for (i =0 ; i <ARRAY_SIZE (torture_ops); i++)pr_alert (" %s" , torture_ops[i]->name);pr_alert ("\n" ); -torture_init_end (); -return -EINVAL ; + firsterr = -EINVAL ; + goto unwind; }if (cur_ops->fqs ==NULL && fqs_duration !=0 ) {pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; }if (cur_ops->init) - cur_ops->init ();/* no "goto unwind" prior to this point!!! */ + cur_ops->init ();if (nreaders >=0 ) { nrealreaders = nreaders;
Signature · 1 line
2.5.2
PATCH 2/4 rcutorture: Fix unused-function warning for torturing_tasks()
The torturing_tasks() function is used only in kernels built with CONFIG_PROVE_RCU=y, so the second definition can result in unused-function compiler warnings. This commit adds __maybe_unused to suppress these warnings.
--- kernel/rcu/rcutorture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/rcutorture.c +1 -1
@@ -695,7 +695,7 @@ static bool __maybe_unused torturing_tasks(void)#define RCUTORTURE_TASKS_OPS -static bool torturing_tasks (void ) +static bool __maybe_unused torturing_tasks (void ) {return false; }
Signature · 1 line
2.5.2
Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified
In reply to Paul E. McKenneyQuoted 8 lines · Paul E. McKenney
The rcutorture module has a list of torture types, and specifying a type not on this list is supposed to cleanly fail the module load. Unfortunately, the "fail" happens without the "cleanly". This commit therefore adds the needed clean-up after an incorrect
torture_type.Reported-by David Miller <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>Acked-by David Miller <[email protected]>
After a careful review of rcu_torture_cleanup and the cur_ops->init() functions to verify that the dire comment about not using "goto unwind" doesn't actually apply (rcu_torture_cleanup *seems* to handle lack of init), this seems fine.
Quoted 29 lines
kernel/rcu/rcutorture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)kernel/rcu/rcutorture.c +3
-3@@ -1742,15 +1742,15 @@ rcu_torture_init(void)for (i =0 ; i <ARRAY_SIZE (torture_ops); i++)pr_alert (" %s" , torture_ops[i]->name);pr_alert ("\n" ); -torture_init_end (); -return -EINVAL ; + firsterr = -EINVAL ; + goto unwind; }if (cur_ops->fqs ==NULL && fqs_duration !=0 ) {pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; }if (cur_ops->init) - cur_ops->init ();/* no "goto unwind" prior to this point!!! */ + cur_ops->init ();if (nreaders >=0 ) { nrealreaders = nreaders;Signature · 1 line
2.5.2
Quoted 11 lines · Paul E. McKenney
Hello!
This series contains torture-test changes:
1. Fix module unwind when bad
torture_typespecified to rcutorture.2. Fix unused-function warning for
torturing_tasks().3. Forgive non-plural arguments.
4. Fix module unwind when bad
torture_typespecified to locktorture.
For all four:
Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified
In reply to Josh TriplettQuoted 6 lines · Josh Triplett
Quoted 5 lines · Paul E. McKenney
The rcutorture module has a list of torture types, and specifying a type not on this list is supposed to cleanly fail the module load. Unfortunately, the "fail" happens without the "cleanly". This commit therefore adds the needed clean-up after an incorrect
torture_type.
Quoted 8 lines
Quoted 3 lines
Reported-by David Miller <[email protected]>Signed-off-by Paul E. McKenney <[email protected]>Acked-by David Miller <[email protected]>After a careful review of
rcu_torture_cleanupand thecur_ops->init()functions to verify that the dire comment about not using "goto unwind" doesn't actually apply (rcu_torture_cleanup*seems* to handle lack of init), this seems fine.
I was indeed a bit nervous about removing that comment, so thank you for checking up on it! (Can't be bothered to go back and figure out if it ever really was relevant...)
Thanx, Paul
Quoted 32 lines
Reviewed-by Josh Triplett <[email protected]>Quoted 29 lines
kernel/rcu/rcutorture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)kernel/rcu/rcutorture.c +3
-3@@ -1742,15 +1742,15 @@ rcu_torture_init(void)for (i =0 ; i <ARRAY_SIZE (torture_ops); i++)pr_alert (" %s" , torture_ops[i]->name);pr_alert ("\n" ); -torture_init_end (); -return -EINVAL ; + firsterr = -EINVAL ; + goto unwind; }if (cur_ops->fqs ==NULL && fqs_duration !=0 ) {pr_alert ("rcu-torture: ->fqs NULL and non-zero fqs_duration, fqs disabled.\n" ); fqs_duration =0 ; }if (cur_ops->init) - cur_ops->init ();/* no "goto unwind" prior to this point!!! */ + cur_ops->init ();if (nreaders >=0 ) { nrealreaders = nreaders;Signature · 1 line
2.5.2