From patchwork Sat Dec 3 18:34:42 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: 5437 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 C450723E03 for ; Sat, 3 Dec 2011 18:34:54 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id A3D11A18364 for ; Sat, 3 Dec 2011 18:34:54 +0000 (UTC) Received: by mail-lpp01m010-f52.google.com with SMTP id h2so2304387laa.11 for ; Sat, 03 Dec 2011 10:34:54 -0800 (PST) Received: by 10.152.104.206 with SMTP id gg14mr2017172lab.41.1322937294542; Sat, 03 Dec 2011 10:34:54 -0800 (PST) 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.41.198 with SMTP id h6cs193907lal; Sat, 3 Dec 2011 10:34:54 -0800 (PST) Received: by 10.68.47.4 with SMTP id z4mr7576478pbm.39.1322937293136; Sat, 03 Dec 2011 10:34:53 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com. [32.97.182.144]) by mx.google.com with ESMTPS id e6si13647697pbd.140.2011.12.03.10.34.52 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 03 Dec 2011 10:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.144 as permitted sender) client-ip=32.97.182.144; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.144 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e4.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 3 Dec 2011 13:34:51 -0500 Received: from d01relay06.pok.ibm.com (9.56.227.116) by e4.ny.us.ibm.com (192.168.1.104) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 3 Dec 2011 13:34:50 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pB3IYnix3375190 for ; Sat, 3 Dec 2011 13:34:49 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pB3IYlGS019857 for ; Sat, 3 Dec 2011 13:34:49 -0500 Received: from paulmck-ThinkPad-W500 (sig-9-65-206-211.mts.ibm.com [9.65.206.211]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pB3IYko9019807; Sat, 3 Dec 2011 13:34:46 -0500 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 204F1EAA0C; Sat, 3 Dec 2011 10:34:44 -0800 (PST) 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, Yong Zhang , "Paul E. McKenney" Subject: [PATCH RFC tip/core/rcu 7/7] rcu: Quiet RCU-lockdep warnings involving interrupt disabling Date: Sat, 3 Dec 2011 10:34:42 -0800 Message-Id: <1322937282-19846-7-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20111203183417.GA18914@linux.vnet.ibm.com> References: <20111203183417.GA18914@linux.vnet.ibm.com> x-cbid: 11120318-3534-0000-0000-0000033BF6B2 From: Yong Zhang RCU-lockdep will issue warnings given the following use pattern: rcu_read_lock(); local_irq_disable(); rcu_read_unlock(); local_irq_enable(); However, this use pattern is legal except for the scheduler's runqueue and priority-inheritance locks (and any other locks that the scheduler might use during priority-inheritance operations). Signed-off-by: Yong Zhang Signed-off-by: Paul E. McKenney --- kernel/rcutree_plugin.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 8cd9efe..2020e8a 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h @@ -401,8 +401,11 @@ static noinline void rcu_read_unlock_special(struct task_struct *t) #ifdef CONFIG_RCU_BOOST /* Unboost if we were boosted. */ - if (rbmp) + if (rbmp) { + local_irq_save(flags); rt_mutex_unlock(rbmp); + local_irq_restore(flags); + } #endif /* #ifdef CONFIG_RCU_BOOST */ /* @@ -1233,9 +1236,10 @@ static int rcu_boost(struct rcu_node *rnp) lockdep_set_class_and_name(&mtx.wait_lock, &rcu_boost_class, "rcu_boost_mutex"); t->rcu_boost_mutex = &mtx; - raw_spin_unlock_irqrestore(&rnp->lock, flags); + raw_spin_unlock(&rnp->lock); /* rrupts remain disabled. */ rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ + local_irq_restore(flags); return rnp->exp_tasks != NULL || rnp->boost_tasks != NULL; }