Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755128AbdLFLAA (ORCPT ); Wed, 6 Dec 2017 06:00:00 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2213 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755028AbdLFK7o (ORCPT ); Wed, 6 Dec 2017 05:59:44 -0500 From: To: CC: , , Subject: =?UTF-8?q?=5BPATCH=202/2=5D=20rcutorture=3A=20Add=20tests=20of=20param=20usage=20warnings?= Date: Wed, 6 Dec 2017 18:51:08 +0800 Message-ID: <1512557468-52633-3-git-send-email-lianglihao@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1512557468-52633-1-git-send-email-lianglihao@huawei.com> References: <1512557468-52633-1-git-send-email-lianglihao@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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 Content-Length: 3795 Lines: 100 From: Lihao Liang Test the first patch of this patch series Signed-off-by: Lihao Liang --- This patch is for testing purposes only and is not intended to be merged. It seems that the scripts didn’t pick up the lines in BUSTED02.boot that set the value of gp_normal and gp_exp. But when I hard-coded gp_normal to true in rcutorture.c, it did print out "rcu_torture_writer3: gp_sync without primitives" as expected. kernel/rcu/rcutorture.c | 14 ++++++++------ tools/testing/selftests/rcutorture/configs/rcu/BUSTED02 | 7 +++++++ .../testing/selftests/rcutorture/configs/rcu/BUSTED02.boot | 1 + tools/testing/selftests/rcutorture/configs/rcu/CFLIST | 2 ++ 4 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/BUSTED02 create mode 100644 tools/testing/selftests/rcutorture/configs/rcu/BUSTED02.boot diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index d2abebd..233be41 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -465,10 +465,12 @@ static void rcu_busted_torture_deferred_free(struct rcu_torture *p) rcu_torture_cb(&p->rtort_rcu); } +#if 0 static void synchronize_rcu_busted(void) { /* This is a deliberate bug for testing purposes only! */ } +#endif static void call_rcu_busted(struct rcu_head *head, rcu_callback_t func) @@ -486,8 +488,8 @@ static struct rcu_torture_ops rcu_busted_ops = { .started = rcu_no_completed, .completed = rcu_no_completed, .deferred_free = rcu_busted_torture_deferred_free, - .sync = synchronize_rcu_busted, - .exp_sync = synchronize_rcu_busted, + .sync = NULL, + .exp_sync = NULL, .call = call_rcu_busted, .cb_barrier = NULL, .fqs = NULL, @@ -939,13 +941,13 @@ rcu_torture_writer(void *arg) pr_alert("%s: gp_sync without primitives.\n", __func__); if (gp_normal == gp_exp) { if (!cur_ops->sync) - pr_alert("%s: gp_sync without primitives.\n", __func__); + pr_alert("%s 1: gp_sync without primitives.\n", __func__); if (!cur_ops->exp_sync) - pr_alert("%s: gp_exp without primitives.\n", __func__); + pr_alert("%s 2: gp_exp without primitives.\n", __func__); } else if (gp_normal && !cur_ops->sync) { - pr_alert("%s: gp_sync without primitives.\n", __func__); + pr_alert("%s 3: gp_sync without primitives.\n", __func__); } else if (gp_exp && !cur_ops->exp_sync) { - pr_alert("%s: gp_exp without primitives.\n", __func__); + pr_alert("%s 4: gp_exp without primitives.\n", __func__); } if (WARN_ONCE(nsynctypes == 0, "rcu_torture_writer: No update-side primitives.\n")) { diff --git a/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02 b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02 new file mode 100644 index 0000000..48d8a24 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02 @@ -0,0 +1,7 @@ +CONFIG_RCU_TRACE=n +CONFIG_SMP=y +CONFIG_NR_CPUS=4 +CONFIG_HOTPLUG_CPU=y +CONFIG_PREEMPT_NONE=n +CONFIG_PREEMPT_VOLUNTARY=n +CONFIG_PREEMPT=y diff --git a/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02.boot b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02.boot new file mode 100644 index 0000000..40cf978 --- /dev/null +++ b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED02.boot @@ -0,0 +1 @@ +rcutorture.torture_type=busted rcutorture.gp_normal=true rcutorture.gp_sync=false diff --git a/tools/testing/selftests/rcutorture/configs/rcu/CFLIST b/tools/testing/selftests/rcutorture/configs/rcu/CFLIST index 6a0b9f6..e91f8b5 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/CFLIST +++ b/tools/testing/selftests/rcutorture/configs/rcu/CFLIST @@ -16,3 +16,5 @@ TINY02 TASKS01 TASKS02 TASKS03 +BUSTED +BUSTED02 -- 2.7.4