From patchwork Tue Sep 6 18:00:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 3946 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 685AC23F9F for ; Wed, 7 Sep 2011 06:21:24 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 5D0EFA1817A for ; Wed, 7 Sep 2011 06:21:24 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 18so398726fxd.11 for ; Tue, 06 Sep 2011 23:21:24 -0700 (PDT) Received: by 10.223.22.14 with SMTP id l14mr67367fab.100.1315376484280; Tue, 06 Sep 2011 23:21:24 -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.152.11.8 with SMTP id m8cs127814lab; Tue, 6 Sep 2011 23:21:24 -0700 (PDT) Received: by 10.91.66.35 with SMTP id t35mr4546238agk.207.1315376483107; Tue, 06 Sep 2011 23:21:23 -0700 (PDT) Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) by mx.google.com with ESMTPS id t35si4142644anh.41.2011.09.06.23.21.22 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Sep 2011 23:21:23 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.137 as permitted sender) client-ip=32.97.182.137; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.137 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p87514af028933 for ; Wed, 7 Sep 2011 01:01:04 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p876Kim0254070 for ; Wed, 7 Sep 2011 02:21:01 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p876KfZ1004872 for ; Wed, 7 Sep 2011 02:20:44 -0400 Received: from paulmck-ThinkPad-W500 (dyn9050016039.mts.ibm.com [9.50.16.39] (may be forged)) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p876KZPV004575; Wed, 7 Sep 2011 02:20:38 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 941FE13F89F; Tue, 6 Sep 2011 11:00:53 -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, patches@linaro.org, "Paul E. McKenney" , anton@samba.org, benh@kernel.crashing.org, paulus@samba.org Subject: [PATCH tip/core/rcu 55/55] powerpc: Work around tracing from dyntick-idle mode Date: Tue, 6 Sep 2011 11:00:49 -0700 Message-Id: <1315332049-2604-55-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20110906180015.GA2560@linux.vnet.ibm.com> References: <20110906180015.GA2560@linux.vnet.ibm.com> PowerPC LPAR's __trace_hcall_exit() can invoke event tracing at a point where RCU has been told that the CPU is in dyntick-idle mode. Because event tracing uses RCU, this can result in failures. A correct fix would arrange for RCU to be told about dyntick-idle mode after tracing had completed, however, this will require some care because it appears that __trace_hcall_exit() can also be called from non-dyntick-idle mode. Signed-off-by: Paul E. McKenney Cc: anton@samba.org Cc: benh@kernel.crashing.org Cc: paulus@samba.org --- arch/powerpc/platforms/pseries/lpar.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 39e6e0a..668f300 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c @@ -715,12 +715,14 @@ EXPORT_SYMBOL(arch_free_page); /* NB: reg/unreg are called while guarded with the tracepoints_mutex */ extern long hcall_tracepoint_refcount; +#if 0 /* work around buggy use of RCU from dyntick-idle mode */ /* * Since the tracing code might execute hcalls we need to guard against * recursion. One example of this are spinlocks calling H_YIELD on * shared processor partitions. */ static DEFINE_PER_CPU(unsigned int, hcall_trace_depth); +#endif /* #if 0 work around buggy use of RCU from dyntick-idle mode */ void hcall_tracepoint_regfunc(void) { @@ -734,6 +736,7 @@ void hcall_tracepoint_unregfunc(void) void __trace_hcall_entry(unsigned long opcode, unsigned long *args) { +#if 0 /* work around buggy use of RCU from dyntick-idle mode */ unsigned long flags; unsigned int *depth; @@ -750,11 +753,13 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args) out: local_irq_restore(flags); +#endif /* #if 0 work around buggy use of RCU from dyntick-idle mode */ } void __trace_hcall_exit(long opcode, unsigned long retval, unsigned long *retbuf) { +#if 0 /* work around buggy use of RCU from dyntick-idle mode */ unsigned long flags; unsigned int *depth; @@ -771,6 +776,7 @@ void __trace_hcall_exit(long opcode, unsigned long retval, out: local_irq_restore(flags); +#endif /* #if 0 work around buggy use of RCU from dyntick-idle mode */ } #endif