* two RCU torture bugs
@ 2015-08-24 5:07 David Miller
2015-08-24 5:29 ` Paul E. McKenney
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2015-08-24 5:07 UTC (permalink / raw)
To: josh; +Cc: paulmck, linux-kernel
1) Doc bug, documentation mentions torture_type such as "rcu_sync",
but those don't seem to exist.
2) If you specify an unrecognized type, the module cannot be unloaded.
Amusingly it says that it cannot unload because the unrecognized
torture test type you requested is "running" :-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 5:07 two RCU torture bugs David Miller
@ 2015-08-24 5:29 ` Paul E. McKenney
2015-08-24 18:50 ` Paul E. McKenney
0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2015-08-24 5:29 UTC (permalink / raw)
To: David Miller; +Cc: josh, linux-kernel
On Sun, Aug 23, 2015 at 10:07:49PM -0700, David Miller wrote:
>
> 1) Doc bug, documentation mentions torture_type such as "rcu_sync",
> but those don't seem to exist.
>
> 2) If you specify an unrecognized type, the module cannot be unloaded.
> Amusingly it says that it cannot unload because the unrecognized
> torture test type you requested is "running" :-)
Clearly Iftekhar was mutating the wrong code. ;-)
And clearly I need to occasionally test failure cases. There is code that
is supposed to unwind upon failure, but it has apparently bitrotted...
Thanx, Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 5:29 ` Paul E. McKenney
@ 2015-08-24 18:50 ` Paul E. McKenney
2015-08-24 18:56 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2015-08-24 18:50 UTC (permalink / raw)
To: David Miller; +Cc: josh, linux-kernel
On Sun, Aug 23, 2015 at 10:29:15PM -0700, Paul E. McKenney wrote:
> On Sun, Aug 23, 2015 at 10:07:49PM -0700, David Miller wrote:
> >
> > 1) Doc bug, documentation mentions torture_type such as "rcu_sync",
> > but those don't seem to exist.
> >
> > 2) If you specify an unrecognized type, the module cannot be unloaded.
> > Amusingly it says that it cannot unload because the unrecognized
> > torture test type you requested is "running" :-)
>
> Clearly Iftekhar was mutating the wrong code. ;-)
>
> And clearly I need to occasionally test failure cases. There is code that
> is supposed to unwind upon failure, but it has apparently bitrotted...
Do the following pair of untested patches help?
Thanx, Paul
------------------------------------------------------------------------
commit d568705d102ceb61884a3a8b77a98168094acbca
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date: Mon Aug 24 11:37:58 2015 -0700
rcutorture: Fix module unwind when bad torture_type specified
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>
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index f9ec6cbe77d3..9c4f5cd86532 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;
}
@@ -1742,8 +1742,8 @@ 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");
------------------------------------------------------------------------
commit 20f34145cfbba04b44b8fbd29689bdcc0ab0b303
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date: Mon Aug 24 11:46:00 2015 -0700
documentation: Catch up list of torture_type options
This commit rids the documentation of long-obsolete torture_type options
such as rcu_sync and adds new ones such as tasks. Also add verbiage
noting the fact that rcutorture now concurrently tests the asynchrounous,
synchronous, expedited synchronous, and polling grace-period primitives.
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
diff --git a/Documentation/RCU/torture.txt b/Documentation/RCU/torture.txt
index dac02a6219b1..118e7c176ce7 100644
--- a/Documentation/RCU/torture.txt
+++ b/Documentation/RCU/torture.txt
@@ -166,40 +166,27 @@ test_no_idle_hz Whether or not to test the ability of RCU to operate in
torture_type The type of RCU to test, with string values as follows:
- "rcu": rcu_read_lock(), rcu_read_unlock() and call_rcu().
-
- "rcu_sync": rcu_read_lock(), rcu_read_unlock(), and
- synchronize_rcu().
-
- "rcu_expedited": rcu_read_lock(), rcu_read_unlock(), and
- synchronize_rcu_expedited().
+ "rcu": rcu_read_lock(), rcu_read_unlock() and call_rcu(),
+ along with expedited, synchronous, and polling
+ variants.
"rcu_bh": rcu_read_lock_bh(), rcu_read_unlock_bh(), and
- call_rcu_bh().
-
- "rcu_bh_sync": rcu_read_lock_bh(), rcu_read_unlock_bh(),
- and synchronize_rcu_bh().
+ call_rcu_bh(), along with expedited and synchronous
+ variants.
- "rcu_bh_expedited": rcu_read_lock_bh(), rcu_read_unlock_bh(),
- and synchronize_rcu_bh_expedited().
+ "rcu_busted": This tests an intentionally incorrect version
+ of RCU in order to help test rcutorture itself.
"srcu": srcu_read_lock(), srcu_read_unlock() and
- call_srcu().
-
- "srcu_sync": srcu_read_lock(), srcu_read_unlock() and
- synchronize_srcu().
-
- "srcu_expedited": srcu_read_lock(), srcu_read_unlock() and
- synchronize_srcu_expedited().
+ call_srcu(), along with expedited and
+ synchronous variants.
"sched": preempt_disable(), preempt_enable(), and
- call_rcu_sched().
-
- "sched_sync": preempt_disable(), preempt_enable(), and
- synchronize_sched().
+ call_rcu_sched(), along with expedited,
+ synchronous, and polling variants.
- "sched_expedited": preempt_disable(), preempt_enable(), and
- synchronize_sched_expedited().
+ "tasks": voluntary context switch and call_rcu_tasks(),
+ along with expedited and synchronous variants.
Defaults to "rcu".
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 18:50 ` Paul E. McKenney
@ 2015-08-24 18:56 ` David Miller
2015-08-24 20:08 ` Paul E. McKenney
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2015-08-24 18:56 UTC (permalink / raw)
To: paulmck; +Cc: josh, linux-kernel
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Mon, 24 Aug 2015 11:50:36 -0700
> @@ -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;
> }
This hunk gave a reject for me and I suspect was not intended to be included
in this fix?
I'll test the rest of the patch since that appears to be the important part.
:-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 18:56 ` David Miller
@ 2015-08-24 20:08 ` Paul E. McKenney
2015-08-24 20:39 ` David Miller
0 siblings, 1 reply; 7+ messages in thread
From: Paul E. McKenney @ 2015-08-24 20:08 UTC (permalink / raw)
To: David Miller; +Cc: josh, linux-kernel
On Mon, Aug 24, 2015 at 11:56:59AM -0700, David Miller wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Date: Mon, 24 Aug 2015 11:50:36 -0700
>
> > @@ -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;
> > }
>
> This hunk gave a reject for me and I suspect was not intended to be included
> in this fix?
Yeah, I should split that out, thank you for calling it out. And yes,
I made the patch against my experimental branch, so mileage may vary.
> I'll test the rest of the patch since that appears to be the important part.
> :-)
Thank you!
Thanx, Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 20:08 ` Paul E. McKenney
@ 2015-08-24 20:39 ` David Miller
2015-08-24 20:58 ` Paul E. McKenney
0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2015-08-24 20:39 UTC (permalink / raw)
To: paulmck; +Cc: josh, linux-kernel
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Mon, 24 Aug 2015 13:08:37 -0700
> On Mon, Aug 24, 2015 at 11:56:59AM -0700, David Miller wrote:
>> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>> Date: Mon, 24 Aug 2015 11:50:36 -0700
>>
>> > @@ -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;
>> > }
>>
>> This hunk gave a reject for me and I suspect was not intended to be included
>> in this fix?
>
> Yeah, I should split that out, thank you for calling it out. And yes,
> I made the patch against my experimental branch, so mileage may vary.
>
>> I'll test the rest of the patch since that appears to be the important part.
>> :-)
>
> Thank you!
It appears to work and the documentation update looks great too, so for both:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: two RCU torture bugs
2015-08-24 20:39 ` David Miller
@ 2015-08-24 20:58 ` Paul E. McKenney
0 siblings, 0 replies; 7+ messages in thread
From: Paul E. McKenney @ 2015-08-24 20:58 UTC (permalink / raw)
To: David Miller; +Cc: josh, linux-kernel
On Mon, Aug 24, 2015 at 01:39:48PM -0700, David Miller wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Date: Mon, 24 Aug 2015 13:08:37 -0700
>
> > On Mon, Aug 24, 2015 at 11:56:59AM -0700, David Miller wrote:
> >> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> >> Date: Mon, 24 Aug 2015 11:50:36 -0700
> >>
> >> > @@ -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;
> >> > }
> >>
> >> This hunk gave a reject for me and I suspect was not intended to be included
> >> in this fix?
> >
> > Yeah, I should split that out, thank you for calling it out. And yes,
> > I made the patch against my experimental branch, so mileage may vary.
> >
> >> I'll test the rest of the patch since that appears to be the important part.
> >> :-)
> >
> > Thank you!
>
> It appears to work and the documentation update looks great too, so for both:
>
> Acked-by: David S. Miller <davem@davemloft.net>
Thank you very much, applied!
Thanx, Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-24 20:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 5:07 two RCU torture bugs David Miller
2015-08-24 5:29 ` Paul E. McKenney
2015-08-24 18:50 ` Paul E. McKenney
2015-08-24 18:56 ` David Miller
2015-08-24 20:08 ` Paul E. McKenney
2015-08-24 20:39 ` David Miller
2015-08-24 20:58 ` Paul E. McKenney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox