linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 12/16] prcu: Add PRCU Kconfig parameter
Date: Tue, 23 Jan 2018 15:59:37 +0800	[thread overview]
Message-ID: <1516694381-20333-13-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>

Signed-off-by: Lihao Liang <lianglihao@huawei.com>
---
 include/linux/prcu.h | 14 ++++++--------
 init/Kconfig         |  7 +++++++
 kernel/rcu/Makefile  |  3 ++-
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/include/linux/prcu.h b/include/linux/prcu.h
index cce967fd..bb20fa40 100644
--- a/include/linux/prcu.h
+++ b/include/linux/prcu.h
@@ -7,8 +7,7 @@
 #include <linux/wait.h>
 #include <linux/completion.h>
 
-#define CONFIG_PRCU
-
+#ifdef CONFIG_PRCU
 struct prcu_version_head {
 	unsigned long long version;
 	struct prcu_version_head *next;
@@ -48,7 +47,6 @@ struct prcu_struct {
 	struct completion barrier_completion;
 };
 
-#ifdef CONFIG_PRCU
 void prcu_read_lock(void);
 void prcu_read_unlock(void);
 void synchronize_prcu(void);
@@ -62,11 +60,11 @@ void prcu_check_callbacks(void);
 
 #else /* #ifdef CONFIG_PRCU */
 
-#define prcu_read_lock() do {} while (0)
-#define prcu_read_unlock() do {} while (0)
-#define synchronize_prcu() do {} while (0)
-#define call_prcu() do {} while (0)
-#define prcu_barrier() do {} while (0)
+#define prcu_read_lock rcu_read_lock
+#define prcu_read_unlock rcu_read_unlock
+#define synchronize_prcu synchronize_rcu
+#define call_prcu call_rcu
+#define prcu_barrier rcu_barrier
 #define prcu_init() do {} while (0)
 #define prcu_note_context_switch() do {} while (0)
 #define prcu_pending() 0
diff --git a/init/Kconfig b/init/Kconfig
index 1d3475fc..c1fd80f9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -565,6 +565,13 @@ config TASKS_RCU
 	  only voluntary context switch (not preemption!), idle, and
 	  user-mode execution as quiescent states.
 
+config PRCU
+	bool
+	default y
+	help
+	  This option selects the PRCU implementation based on a fast
+	  consensus protocol.
+
 config RCU_STALL_COMMON
 	def_bool ( TREE_RCU || PREEMPT_RCU || RCU_TRACE )
 	help
diff --git a/kernel/rcu/Makefile b/kernel/rcu/Makefile
index 8791419c..9074b395 100644
--- a/kernel/rcu/Makefile
+++ b/kernel/rcu/Makefile
@@ -2,7 +2,7 @@
 # and is generally not a function of system call inputs.
 KCOV_INSTRUMENT := n
 
-obj-y += update.o sync.o prcu.o
+obj-y += update.o sync.o
 obj-$(CONFIG_CLASSIC_SRCU) += srcu.o
 obj-$(CONFIG_TREE_SRCU) += srcutree.o
 obj-$(CONFIG_TINY_SRCU) += srcutiny.o
@@ -12,4 +12,5 @@ obj-$(CONFIG_TREE_RCU) += tree.o
 obj-$(CONFIG_PREEMPT_RCU) += tree.o
 obj-$(CONFIG_TREE_RCU_TRACE) += tree_trace.o
 obj-$(CONFIG_TINY_RCU) += tiny.o
+obj-$(CONFIG_PRCU) += prcu.o
 obj-$(CONFIG_RCU_NEED_SEGCBLIST) += rcu_segcblist.o
-- 
2.14.1.729.g59c0ea183

  parent reply	other threads:[~2018-01-23  8:11 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 ` [PATCH RFC 02/16] rcutorture: Add PRCU rcu_torture_ops lianglihao
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 ` lianglihao [this message]
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-13-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;
as well as URLs for NNTP newsgroup(s).