From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723Ab1GWXUb (ORCPT ); Sat, 23 Jul 2011 19:20:31 -0400 Received: from www.linutronix.de ([62.245.132.108]:37693 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751329Ab1GWXU2 (ORCPT ); Sat, 23 Jul 2011 19:20:28 -0400 Date: Sun, 24 Jul 2011 01:20:08 +0200 (CEST) From: Thomas Gleixner To: "Paul E. McKenney" cc: Peter Zijlstra , laijs@cn.fujitsu.com, darren@dvhart.com, rostedt@goodmis.org, mingo@elte.hu, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] rtmutex: Permit rt_mutex_unlock() to be invoked with irqs disabled In-Reply-To: <20110723220348.GD2415@linux.vnet.ibm.com> Message-ID: References: <20110719201410.GA10553@linux.vnet.ibm.com> <1311247968.29152.122.camel@twins> <20110723220348.GD2415@linux.vnet.ibm.com> User-Agent: Alpine 2.02 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Jul 2011, Paul E. McKenney wrote: > On Thu, Jul 21, 2011 at 01:32:48PM +0200, Peter Zijlstra wrote: > > On Tue, 2011-07-19 at 13:14 -0700, Paul E. McKenney wrote: > > > Because rcu_read_unlock() can be invoked with interrupts disabled, it can > > > in turn invoke rt_mutex_unlock() with interrupts disabled. This situation > > > results in lockdep splats (https://lkml.org/lkml/2011/7/7/362) because the > > > rt_mutex structure's ->lock_wait is acquired elsewhere without disabling > > > interrupts, which can result in deadlocks. > > > > > > This commit therefore changes the rt_mutex structure's ->lock_wait > > > acquisitions to disable interrupts. > > > > > > An alternative fix is to prohibit invoking rcu_read_unlock() with > > > interrupts disabled unless the entire preceding RCU read-side critical > > > section has run with interrupts disabled. However, there is already > > > at least one case in mainline where this potential rule is violated, > > > and there might well be many more. These would likely be found one at > > > a time using the lockdep-water-torture method, hence the alternative > > > fix in the form of this commit. > > > > Thomas, I'm inclined to merge this, any objections? > > FWIW, it has been passing tests here. If it's only the unlock path, I'm fine with that change. Acked-by-me