All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, matthltc@us.ibm.com, dipankar@in.ibm.com,
	arjan@infradead.org, ioe-lkml@rameria.de, greg@kroah.com,
	pbadari@us.ibm.com, mrmacman_g4@mac.com, hugh@veritas.com,
	vatsa@in.ibm.com
Subject: [PATCH 0/3] rcutorture: add call_rcu_bh() operations
Date: Mon, 26 Jun 2006 11:58:12 -0700	[thread overview]
Message-ID: <20060626185812.GC2141@us.ibm.com> (raw)
In-Reply-To: <20060626184821.GA2091@us.ibm.com>

Add operations for the call_rcu_bh() variant of RCU.  Also add an
rcu_batches_completed_bh() function, which is needed by rcutorture.

Signed-off-by: Paul E. McKenney <paulmck@us.ibm.com>
---

 include/linux/rcupdate.h |    1 +
 kernel/rcupdate.c        |   10 ++++++++++
 kernel/rcutorture.c      |   40 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 49 insertions(+), 2 deletions(-)

diff -urpNa -X dontdiff linux-2.6.17-tortureops/include/linux/rcupdate.h linux-2.6.17-torturercu_bh/include/linux/rcupdate.h
--- linux-2.6.17-tortureops/include/linux/rcupdate.h	2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-torturercu_bh/include/linux/rcupdate.h	2006-06-23 22:45:12.000000000 -0700
@@ -258,6 +258,7 @@ extern void rcu_init(void);
 extern void rcu_check_callbacks(int cpu, int user);
 extern void rcu_restart_cpu(int cpu);
 extern long rcu_batches_completed(void);
+extern long rcu_batches_completed_bh(void);
 
 /* Exported interfaces */
 extern void FASTCALL(call_rcu(struct rcu_head *head, 
diff -urpNa -X dontdiff linux-2.6.17-tortureops/kernel/rcupdate.c linux-2.6.17-torturercu_bh/kernel/rcupdate.c
--- linux-2.6.17-tortureops/kernel/rcupdate.c	2006-06-17 18:49:35.000000000 -0700
+++ linux-2.6.17-torturercu_bh/kernel/rcupdate.c	2006-06-23 22:40:09.000000000 -0700
@@ -182,6 +182,15 @@ long rcu_batches_completed(void)
 	return rcu_ctrlblk.completed;
 }
 
+/*
+ * Return the number of RCU batches processed thus far.  Useful
+ * for debug and statistics.
+ */
+long rcu_batches_completed_bh(void)
+{
+	return rcu_bh_ctrlblk.completed;
+}
+
 static void rcu_barrier_callback(struct rcu_head *notused)
 {
 	if (atomic_dec_and_test(&rcu_barrier_cpu_count))
@@ -627,6 +636,7 @@ module_param(qlowmark, int, 0);
 module_param(rsinterval, int, 0);
 #endif
 EXPORT_SYMBOL_GPL(rcu_batches_completed);
+EXPORT_SYMBOL_GPL(rcu_batches_completed_bh);
 EXPORT_SYMBOL_GPL_FUTURE(call_rcu);	/* WARNING: GPL-only in April 2006. */
 EXPORT_SYMBOL_GPL_FUTURE(call_rcu_bh);	/* WARNING: GPL-only in April 2006. */
 EXPORT_SYMBOL_GPL(synchronize_rcu);
diff -urpNa -X dontdiff linux-2.6.17-tortureops/kernel/rcutorture.c linux-2.6.17-torturercu_bh/kernel/rcutorture.c
--- linux-2.6.17-tortureops/kernel/rcutorture.c	2006-06-24 11:51:47.000000000 -0700
+++ linux-2.6.17-torturercu_bh/kernel/rcutorture.c	2006-06-24 11:52:08.000000000 -0700
@@ -66,7 +66,7 @@ MODULE_PARM_DESC(test_no_idle_hz, "Test 
 module_param(shuffle_interval, int, 0);
 MODULE_PARM_DESC(shuffle_interval, "Number of seconds between shuffles");
 module_param(torture_type, charp, 0);
-MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu)");
+MODULE_PARM_DESC(torture_type, "Type of RCU to torture (rcu, rcu_bh)");
 
 #define TORTURE_FLAG "-torture:"
 #define PRINTK_STRING(s) \
@@ -246,8 +246,44 @@ static struct rcu_torture_ops rcu_ops = 
 	.name = "rcu"
 };
 
+/*
+ * Definitions for rcu_bh torture testing.
+ */
+
+static int rcu_bh_torture_read_lock(void)
+{
+	rcu_read_lock_bh();
+	return 0;
+}
+
+static void rcu_bh_torture_read_unlock(int idx)
+{
+	rcu_read_unlock_bh();
+}
+
+static int rcu_bh_torture_completed(void)
+{
+	return rcu_batches_completed_bh();
+}
+
+static void rcu_bh_torture_deferred_free(struct rcu_torture *p)
+{
+	call_rcu_bh(&p->rtort_rcu, rcu_torture_cb);
+}
+
+static struct rcu_torture_ops rcu_bh_ops = {
+	.init = NULL,
+	.cleanup = NULL,
+	.readlock = rcu_bh_torture_read_lock,
+	.readunlock = rcu_bh_torture_read_unlock,
+	.completed = rcu_bh_torture_completed,
+	.deferredfree = rcu_bh_torture_deferred_free,
+	.stats = NULL,
+	.name = "rcu_bh"
+};
+
 static struct rcu_torture_ops *torture_ops[] =
-	{ &rcu_ops, NULL };
+	{ &rcu_ops, &rcu_bh_ops, NULL };
 
 /*
  * RCU torture writer kthread.  Repeatedly substitutes a new structure

  parent reply	other threads:[~2006-06-26 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 18:48 [PATCH 0/3] 2.6.17 rcutorture: add ops vector to test multiple RCUs Paul E. McKenney
2006-06-26 18:52 ` [PATCH 1/3] rcutorture: catchup doc fixes for idle-hz tests Paul E. McKenney
2006-06-26 18:55 ` [PATCH 2/3] rcutorture: add ops vector and Classic RCU ops Paul E. McKenney
2006-06-26 18:58 ` Paul E. McKenney [this message]
2006-06-26 19:17   ` [PATCH 0/3] rcutorture: add call_rcu_bh() operations 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=20060626185812.GC2141@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=dipankar@in.ibm.com \
    --cc=greg@kroah.com \
    --cc=hugh@veritas.com \
    --cc=ioe-lkml@rameria.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthltc@us.ibm.com \
    --cc=mrmacman_g4@mac.com \
    --cc=pbadari@us.ibm.com \
    --cc=vatsa@in.ibm.com \
    /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.