From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbeAWILg (ORCPT ); Tue, 23 Jan 2018 03:11:36 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:38687 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751241AbeAWIIs (ORCPT ); Tue, 23 Jan 2018 03:08:48 -0500 From: To: CC: , , , , Subject: [PATCH RFC 04/16] rcuperf: Add PRCU rcu_perf_ops Date: Tue, 23 Jan 2018 15:59:29 +0800 Message-ID: <1516694381-20333-5-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 --- kernel/rcu/rcuperf.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c index a4a86fb4..ea80fa3e 100644 --- a/kernel/rcu/rcuperf.c +++ b/kernel/rcu/rcuperf.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -304,6 +305,34 @@ static bool __maybe_unused torturing_tasks(void) #endif /* #else #ifdef CONFIG_TASKS_RCU */ +/* + * Definitions for prcu perf testing. + */ + +static int prcu_perf_read_lock(void) __acquires(RCU) +{ + prcu_read_lock(); + return 0; +} + +static void prcu_perf_read_unlock(int idx) __releases(RCU) +{ + prcu_read_unlock(); +} + +static struct rcu_perf_ops prcu_ops = { + .ptype = PRCU_FLAVOR, + .init = rcu_sync_perf_init, + .readlock = prcu_perf_read_lock, + .readunlock = prcu_perf_read_unlock, + .started = rcu_no_completed, + .completed = rcu_no_completed, + .exp_completed = rcu_no_completed, + .sync = synchronize_prcu, + .exp_sync = synchronize_prcu, + .name = "prcu" +}; + /* * If performance tests complete, wait for shutdown to commence. */ @@ -554,7 +583,7 @@ rcu_perf_init(void) long i; int firsterr = 0; static struct rcu_perf_ops *perf_ops[] = { - &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops, + &rcu_ops, &rcu_bh_ops, &srcu_ops, &sched_ops, &prcu_ops, RCUPERF_TASKS_OPS }; -- 2.14.1.729.g59c0ea183