From: <lianglihao@huawei.com>
To: <paulmck@linux.vnet.ibm.com>
Cc: <guohanjun@huawei.com>, <heng.z@huawei.com>, <hb.chen@huawei.com>,
<lihao.liang@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH RFC 02/16] rcutorture: Add PRCU rcu_torture_ops
Date: Tue, 23 Jan 2018 15:59:27 +0800 [thread overview]
Message-ID: <1516694381-20333-3-git-send-email-lianglihao@huawei.com> (raw)
In-Reply-To: <1516694381-20333-1-git-send-email-lianglihao@huawei.com>
From: Lihao Liang <lianglihao@huawei.com>
Reviewed-by: Heng Zhang <heng.z@huawei.com>
Signed-off-by: Lihao Liang <lianglihao@huawei.com>
---
include/linux/rcupdate.h | 1 +
kernel/rcu/rcutorture.c | 40 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e1e5d002..12df9709 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -84,6 +84,7 @@ enum rcutorture_type {
RCU_SCHED_FLAVOR,
RCU_TASKS_FLAVOR,
SRCU_FLAVOR,
+ PRCU_FLAVOR,
INVALID_RCU_FLAVOR
};
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index ae6e574d..7d65bf0c 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -46,6 +46,7 @@
#include <linux/delay.h>
#include <linux/stat.h>
#include <linux/srcu.h>
+#include <linux/prcu.h>
#include <linux/slab.h>
#include <linux/trace_clock.h>
#include <asm/byteorder.h>
@@ -768,6 +769,43 @@ static bool __maybe_unused torturing_tasks(void)
#endif /* #else #ifdef CONFIG_TASKS_RCU */
+/*
+ * Definitions for prcu torture testing.
+ */
+
+static int prcu_torture_read_lock(void) __acquires(RCU)
+{
+ prcu_read_lock();
+ return 0;
+}
+
+static void prcu_torture_read_unlock(int idx) __releases(RCU)
+{
+ prcu_read_unlock();
+}
+
+static struct rcu_torture_ops prcu_ops = {
+ .ttype = PRCU_FLAVOR,
+ .init = rcu_sync_torture_init,
+ .readlock = prcu_torture_read_lock,
+ .read_delay = rcu_read_delay, /* just reuse rcu's version. */
+ .readunlock = prcu_torture_read_unlock,
+ .started = rcu_no_completed,
+ .completed = rcu_no_completed,
+ .deferred_free = NULL,
+ .sync = synchronize_prcu,
+ .exp_sync = synchronize_prcu,
+ .get_state = NULL,
+ .cond_sync = NULL,
+ .call = NULL,
+ .cb_barrier = NULL,
+ .fqs = NULL,
+ .stats = NULL,
+ .irq_capable = 1,
+ .can_boost = 0,
+ .name = "prcu"
+};
+
/*
* RCU torture priority-boost testing. Runs one real-time thread per
* CPU for moderate bursts, repeatedly registering RCU callbacks and
@@ -1764,7 +1802,7 @@ rcu_torture_init(void)
int firsterr = 0;
static struct rcu_torture_ops *torture_ops[] = {
&rcu_ops, &rcu_bh_ops, &rcu_busted_ops, &srcu_ops, &srcud_ops,
- &sched_ops, RCUTORTURE_TASKS_OPS
+ &sched_ops, &prcu_ops, RCUTORTURE_TASKS_OPS
};
if (!torture_init_begin(torture_type, verbose, &torture_runnable))
--
2.14.1.729.g59c0ea183
next prev parent reply other threads:[~2018-01-23 8:08 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 7:59 [PATCH RFC 00/16] A new RCU implementation based on a fast consensus protocol lianglihao
2018-01-23 7:59 ` [PATCH RFC 01/16] prcu: Add PRCU implementation lianglihao
2018-01-24 11:26 ` Peter Zijlstra
2018-01-24 17:15 ` Lihao Liang
2018-01-24 20:19 ` Peter Zijlstra
2018-01-25 6:16 ` Paul E. McKenney
2018-01-25 7:30 ` Boqun Feng
2018-01-30 5:34 ` zhangheng (AC)
2018-01-30 6:40 ` Boqun Feng
2018-01-30 10:42 ` zhangheng (AC)
2018-01-27 7:35 ` Lihao Liang
2018-01-30 3:58 ` zhangheng (AC)
2018-01-29 9:10 ` Lai Jiangshan
2018-01-30 6:21 ` zhangheng (AC)
2018-01-23 7:59 ` lianglihao [this message]
2018-01-23 7:59 ` [PATCH RFC 03/16] rcutorture: Add PRCU test config files lianglihao
2018-01-25 6:27 ` Paul E. McKenney
2018-01-23 7:59 ` [PATCH RFC 04/16] rcuperf: Add PRCU rcu_perf_ops lianglihao
2018-01-23 7:59 ` [PATCH RFC 05/16] rcuperf: Add PRCU test config files lianglihao
2018-01-23 7:59 ` [PATCH RFC 06/16] rcuperf: Set gp_exp to true for tests to run lianglihao
2018-01-25 6:18 ` Paul E. McKenney
2018-01-26 8:33 ` Lihao Liang
2018-01-23 7:59 ` [PATCH RFC 07/16] prcu: Implement call_prcu() API lianglihao
2018-01-25 6:20 ` Paul E. McKenney
2018-01-26 8:44 ` Lihao Liang
2018-01-26 22:22 ` Paul E. McKenney
2018-01-23 7:59 ` [PATCH RFC 08/16] prcu: Implement PRCU callback processing lianglihao
2018-01-23 7:59 ` [PATCH RFC 09/16] prcu: Implement prcu_barrier() API lianglihao
2018-01-25 6:24 ` Paul E. McKenney
2018-01-23 7:59 ` [PATCH RFC 10/16] rcutorture: Test call_prcu() and prcu_barrier() lianglihao
2018-01-23 7:59 ` [PATCH RFC 11/16] rcutorture: Add basic ARM64 support to run scripts lianglihao
2018-01-23 7:59 ` [PATCH RFC 12/16] prcu: Add PRCU Kconfig parameter lianglihao
2018-01-23 7:59 ` [PATCH RFC 13/16] prcu: Comment source code lianglihao
2018-01-23 7:59 ` [PATCH RFC 14/16] rcuperf: Add config files with various CONFIG_NR_CPUS lianglihao
2018-01-23 7:59 ` [PATCH RFC 15/16] rcutorture: Add scripts to run experiments lianglihao
2018-01-25 6:28 ` Paul E. McKenney
2018-01-23 7:59 ` [PATCH RFC 16/16] Add GPLv2 license lianglihao
2018-01-25 5:53 ` [PATCH RFC 00/16] A new RCU implementation based on a fast consensus protocol Paul E. McKenney
2018-01-27 7:22 ` Lihao Liang
2018-01-27 7:57 ` Paul E. McKenney
2018-01-27 9:57 ` Lihao Liang
2018-01-27 23:46 ` Paul E. McKenney
2018-01-27 23:41 ` 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=1516694381-20333-3-git-send-email-lianglihao@huawei.com \
--to=lianglihao@huawei.com \
--cc=guohanjun@huawei.com \
--cc=hb.chen@huawei.com \
--cc=heng.z@huawei.com \
--cc=lihao.liang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®