linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH tip/core/rcu 0/4] torture-test changes for 4.4
@ 2015-10-06 16:48 Paul E. McKenney
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
  2015-10-06 17:33 ` [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Josh Triplett
  0 siblings, 2 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 16:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, dvhart, fweisbec,
	oleg, bobby.prani

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(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified
  2015-10-06 16:48 [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Paul E. McKenney
@ 2015-10-06 16:49 ` Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks() Paul E. McKenney
                     ` (3 more replies)
  2015-10-06 17:33 ` [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Josh Triplett
  1 sibling, 4 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 16:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, dvhart, fweisbec,
	oleg, bobby.prani, 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 <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: David Miller <davem@davemloft.net>
---
 kernel/rcu/rcutorture.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 77192953dee5..b74b56474e17 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -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;
-- 
2.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks()
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
@ 2015-10-06 16:49   ` Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 3/4] torture: Forgive non-plural arguments Paul E. McKenney
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 16:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, dvhart, fweisbec,
	oleg, bobby.prani, Paul E. McKenney

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.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/rcutorture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index b74b56474e17..009b62c76dfa 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -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;
 }
-- 
2.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH tip/core/rcu 3/4] torture: Forgive non-plural arguments
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks() Paul E. McKenney
@ 2015-10-06 16:49   ` Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified Paul E. McKenney
  2015-10-06 17:32   ` [PATCH tip/core/rcu 1/4] rcutorture: " Josh Triplett
  3 siblings, 0 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 16:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, dvhart, fweisbec,
	oleg, bobby.prani, Paul E. McKenney

This 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.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 tools/testing/selftests/rcutorture/bin/kvm.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index fbe2dbff1e21..f6483609ebc2 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -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
-- 
2.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks() Paul E. McKenney
  2015-10-06 16:49   ` [PATCH tip/core/rcu 3/4] torture: Forgive non-plural arguments Paul E. McKenney
@ 2015-10-06 16:49   ` Paul E. McKenney
  2015-10-06 17:32   ` [PATCH tip/core/rcu 1/4] rcutorture: " Josh Triplett
  3 siblings, 0 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 16:49 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, dvhart, fweisbec,
	oleg, bobby.prani, Paul E. McKenney

The 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.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/locking/locktorture.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 32244186f1f2..820852f69858 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -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;
-- 
2.5.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
                     ` (2 preceding siblings ...)
  2015-10-06 16:49   ` [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified Paul E. McKenney
@ 2015-10-06 17:32   ` Josh Triplett
  2015-10-06 18:32     ` Paul E. McKenney
  3 siblings, 1 reply; 8+ messages in thread
From: Josh Triplett @ 2015-10-06 17:32 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, tglx, peterz, rostedt, dhowells, edumazet,
	dvhart, fweisbec, oleg, bobby.prani

On Tue, Oct 06, 2015 at 09:49:10AM -0700, Paul E. McKenney wrote:
> 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 <davem@davemloft.net>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Acked-by: David Miller <davem@davemloft.net>

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.

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

>  kernel/rcu/rcutorture.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> index 77192953dee5..b74b56474e17 100644
> --- a/kernel/rcu/rcutorture.c
> +++ b/kernel/rcu/rcutorture.c
> @@ -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;
> -- 
> 2.5.2
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH tip/core/rcu 0/4] torture-test changes for 4.4
  2015-10-06 16:48 [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Paul E. McKenney
  2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
@ 2015-10-06 17:33 ` Josh Triplett
  1 sibling, 0 replies; 8+ messages in thread
From: Josh Triplett @ 2015-10-06 17:33 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, tglx, peterz, rostedt, dhowells, edumazet,
	dvhart, fweisbec, oleg, bobby.prani

On Tue, Oct 06, 2015 at 09:48:55AM -0700, Paul E. McKenney wrote:
> 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.

For all four:

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified
  2015-10-06 17:32   ` [PATCH tip/core/rcu 1/4] rcutorture: " Josh Triplett
@ 2015-10-06 18:32     ` Paul E. McKenney
  0 siblings, 0 replies; 8+ messages in thread
From: Paul E. McKenney @ 2015-10-06 18:32 UTC (permalink / raw)
  To: Josh Triplett
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, tglx, peterz, rostedt, dhowells, edumazet,
	dvhart, fweisbec, oleg, bobby.prani

On Tue, Oct 06, 2015 at 10:32:12AM -0700, Josh Triplett wrote:
> On Tue, Oct 06, 2015 at 09:49:10AM -0700, Paul E. McKenney wrote:
> > 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 <davem@davemloft.net>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > Acked-by: David Miller <davem@davemloft.net>
> 
> 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.

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

> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> 
> >  kernel/rcu/rcutorture.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> > index 77192953dee5..b74b56474e17 100644
> > --- a/kernel/rcu/rcutorture.c
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -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;
> > -- 
> > 2.5.2
> > 
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-06 18:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 16:48 [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Paul E. McKenney
2015-10-06 16:49 ` [PATCH tip/core/rcu 1/4] rcutorture: Fix module unwind when bad torture_type specified Paul E. McKenney
2015-10-06 16:49   ` [PATCH tip/core/rcu 2/4] rcutorture: Fix unused-function warning for torturing_tasks() Paul E. McKenney
2015-10-06 16:49   ` [PATCH tip/core/rcu 3/4] torture: Forgive non-plural arguments Paul E. McKenney
2015-10-06 16:49   ` [PATCH tip/core/rcu 4/4] locktorture: Fix module unwind when bad torture_type specified Paul E. McKenney
2015-10-06 17:32   ` [PATCH tip/core/rcu 1/4] rcutorture: " Josh Triplett
2015-10-06 18:32     ` Paul E. McKenney
2015-10-06 17:33 ` [PATCH tip/core/rcu 0/4] torture-test changes for 4.4 Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).