All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: David Miller <davem@davemloft.net>
Cc: josh@joshtriplett.org, linux-kernel@vger.kernel.org
Subject: Re: two RCU torture bugs
Date: Mon, 24 Aug 2015 11:50:36 -0700	[thread overview]
Message-ID: <20150824185036.GA20889@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150824052915.GD11078@linux.vnet.ibm.com>

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


  reply	other threads:[~2015-08-24 18:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150824185036.GA20889@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.