From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751389AbeAWILM (ORCPT ); Tue, 23 Jan 2018 03:11:12 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:4715 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751086AbeAWIIv (ORCPT ); Tue, 23 Jan 2018 03:08:51 -0500 From: To: CC: , , , , Subject: [PATCH RFC 12/16] prcu: Add PRCU Kconfig parameter Date: Tue, 23 Jan 2018 15:59:37 +0800 Message-ID: <1516694381-20333-13-git-send-email-lianglihao@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1516694381-20333-1-git-send-email-lianglihao@huawei.com> References: <1516694381-20333-1-git-send-email-lianglihao@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lihao Liang Signed-off-by: Lihao Liang --- 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 #include -#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