From patchwork Fri Jul 8 15:43: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: 2604 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 010A623F41 for ; Fri, 8 Jul 2011 15:44:12 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id BE2EFA187A6 for ; Fri, 8 Jul 2011 15:44:11 +0000 (UTC) Received: by mail-qw0-f52.google.com with SMTP id 8so1421555qwb.11 for ; Fri, 08 Jul 2011 08:44:11 -0700 (PDT) Received: by 10.229.54.12 with SMTP id o12mr1705658qcg.80.1310139851496; Fri, 08 Jul 2011 08:44:11 -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.229.48.135 with SMTP id r7cs139262qcf; Fri, 8 Jul 2011 08:44:11 -0700 (PDT) Received: by 10.52.100.136 with SMTP id ey8mr2901317vdb.136.1310139850082; Fri, 08 Jul 2011 08:44:10 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) by mx.google.com with ESMTPS id f14si12858661vdt.13.2011.07.08.08.44.09 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jul 2011 08:44:10 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.145 as permitted sender) client-ip=32.97.182.145; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.145 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p68FFZN6004405 for ; Fri, 8 Jul 2011 11:15:35 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p68Fi8nW823372 for ; Fri, 8 Jul 2011 11:44:08 -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 p68Fi4fo028144 for ; Fri, 8 Jul 2011 11:44:08 -0400 Received: from paulmck-ThinkPad-W500 (sig-9-65-152-173.mts.ibm.com [9.65.152.173]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p68Fi1Lg027960; Fri, 8 Jul 2011 11:44:02 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id B28E613F802; Fri, 8 Jul 2011 08:43:54 -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, Frederic Weisbecker , "Paul E. McKenney" , Peter Zijlstra Subject: [PATCH RFC tip/core/rcu 2/6] rcu: Inform the user about dynticks-idle mode on PROVE_RCU warning Date: Fri, 8 Jul 2011 08:43:49 -0700 Message-Id: <1310139833-20804-2-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20110708154331.GA20161@linux.vnet.ibm.com> References: <20110708154331.GA20161@linux.vnet.ibm.com> From: Frederic Weisbecker Inform the user if an RCU usage error is detected by lockdep while in an extended quiescent state (in this case, dyntick-idle mode). This is accomplished by adding a line to the RCU lockdep splat indicating whether or not the splat occurred in dyntick-idle mode. Signed-off-by: Frederic Weisbecker Cc: Paul E. McKenney Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Lai Jiangshan Signed-off-by: Paul E. McKenney --- kernel/lockdep.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 298c927..f2bff04 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c @@ -3998,6 +3998,26 @@ void lockdep_rcu_dereference(const char *file, const int line) file, line); printk("\nother info that might help us debug this:\n\n"); printk("\nrcu_scheduler_active = %d, debug_locks = %d\n", rcu_scheduler_active, debug_locks); + + /* + * If a CPU is in dyntick-idle mode (CONFIG_NO_HZ), then RCU + * considers that CPU to be in an "extended quiescent state", + * which means that RCU will be completely ignoring that CPU. + * Therefore, rcu_read_lock() and friends have absolutely no + * effect on a dyntick-idle CPU. In other words, even if a + * dyntick-idle CPU has called rcu_read_lock(), RCU might well + * delete data structures out from under it. RCU really has no + * choice here: if it were to consult the CPU, that would wake + * the CPU up, and the whole point of dyntick-idle mode is to + * allow CPUs to enter extremely deep sleep states. + * + * So complain bitterly if someone does call rcu_read_lock(), + * rcu_read_lock_bh() and so on from extended quiescent states + * such as dyntick-idle mode. + */ + if (rcu_check_extended_qs()) + printk("RCU used illegally from extended quiescent state!\n"); + lockdep_print_held_locks(curr); printk("\nstack backtrace:\n"); dump_stack();