From patchwork Fri Jun 15 18:57:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 9330 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7372423E53 for ; Fri, 15 Jun 2012 18:58:33 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3CE23A18818 for ; Fri, 15 Jun 2012 18:58:33 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so2830542ghb.11 for ; Fri, 15 Jun 2012 11:58:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=mUySv3rw6LggjLW3sv1HU2oRa8CQ87MyPwADCG6NZ+g=; b=AB8Nw8GbXX7MQnsiWrgnA4c2+4U7dwumqErt4BpqzN1IhswgWdcRbqtUL475X3tYjE CTbuXgY8qAib8iRe05OmTFZEK+dsVpzsWT5U8fhw9maAvmdAJcfvwpoyY1LQCub5nHqz HI33nD96CpMJMaRJmYAY8pmCle8YP5gBG5SRcvJtGLKjAOwJKx12m0NJvIMxk5mZutXA KMX8HzxXm9UDDzcVFaj1//gxmBrc1zlj62ZQB9AvoXFZx9r53S/9fRPv1ywnodQClKqf i76wdAsIibOEkS4CuyL4guRdFjuC/algHogG5BUet69UkK/J6NoxMikdSdNU5OVyIyaD jKiw== Received: by 10.42.155.73 with SMTP id t9mr425632icw.48.1339786712873; Fri, 15 Jun 2012 11:58:32 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp163690ibb; Fri, 15 Jun 2012 11:58:32 -0700 (PDT) Received: by 10.68.132.201 with SMTP id ow9mr3723070pbb.160.1339786712220; Fri, 15 Jun 2012 11:58:32 -0700 (PDT) Received: from e37.co.us.ibm.com (e37.co.us.ibm.com. [32.97.110.158]) by mx.google.com with ESMTPS id gg10si694755pbc.114.2012.06.15.11.58.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jun 2012 11:58:32 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.158 as permitted sender) client-ip=32.97.110.158; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.158 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2012 12:58:29 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Jun 2012 12:58:13 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 0F3DA3E40047 for ; Fri, 15 Jun 2012 18:58:10 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5FIw6ia186092 for ; Fri, 15 Jun 2012 12:58:07 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5FIvxHW023854 for ; Fri, 15 Jun 2012 12:58:06 -0600 Received: from paulmck-ThinkPad-W500 ([9.47.24.152]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5FIvvx3023766; Fri, 15 Jun 2012 12:57:57 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 6843BE719E; Fri, 15 Jun 2012 11:57:57 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 3/6] rcu: Test srcu_barrier() from rcutorture test suite Date: Fri, 15 Jun 2012 11:57:51 -0700 Message-Id: <1339786674-25265-3-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1339786674-25265-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120615185725.GA25163@linux.vnet.ibm.com> <1339786674-25265-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061518-7408-0000-0000-000005E4039A X-Gm-Message-State: ALoCoQmdLZLwcrSN8aBsaTkbCNEpVqsFSbI0NcLvoOvoWOjYFi+w89nhUnMSKmYfp/vQHjlCjEGf From: "Paul E. McKenney" SRCU now has a call_srcu() and an srcu_barrier(), but rcutorture does not test srcu_barrier(). This commit adds the machinery to allow rcutorture's existing rcu_barrier() tests to apply to SRCU. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- kernel/rcutorture.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index 9850479..7b6935e 100644 --- a/kernel/rcutorture.c +++ b/kernel/rcutorture.c @@ -635,6 +635,17 @@ static void srcu_torture_synchronize(void) synchronize_srcu(&srcu_ctl); } +static void srcu_torture_call(struct rcu_head *head, + void (*func)(struct rcu_head *head)) +{ + call_srcu(&srcu_ctl, head, func); +} + +static void srcu_torture_barrier(void) +{ + srcu_barrier(&srcu_ctl); +} + static int srcu_torture_stats(char *page) { int cnt = 0; @@ -661,8 +672,8 @@ static struct rcu_torture_ops srcu_ops = { .completed = srcu_torture_completed, .deferred_free = srcu_torture_deferred_free, .sync = srcu_torture_synchronize, - .call = NULL, - .cb_barrier = NULL, + .call = srcu_torture_call, + .cb_barrier = srcu_torture_barrier, .stats = srcu_torture_stats, .name = "srcu" };