From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH 13/20] lockdep, mutex: Provide mutex_lock_nest_lock Date: Wed, 20 Apr 2011 13:03:56 +0200 Message-ID: <1303297436.8345.158.camel@twins> References: <20110401121258.211963744@chello.nl> <20110401121725.940769985@chello.nl> <20110419130654.95a14117.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20110419130654.95a14117.akpm@linux-foundation.org> Sender: owner-linux-mm@kvack.org To: Andrew Morton Cc: Andrea Arcangeli , Avi Kivity , Thomas Gleixner , Rik van Riel , Ingo Molnar , Linus Torvalds , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Benjamin Herrenschmidt , David Miller , Hugh Dickins , Mel Gorman , Nick Piggin , Paul McKenney , Yanmin Zhang List-Id: linux-arch.vger.kernel.org On Tue, 2011-04-19 at 13:06 -0700, Andrew Morton wrote: > On Fri, 01 Apr 2011 14:13:11 +0200 > Peter Zijlstra wrote: >=20 > > Provide the mutex_lock_nest_lock() annotation. >=20 > why? >=20 > Neither the changelog nor the code provide any documentation for this add= ition to > the lokdep API. --- Subject: lockdep, mutex: Provide mutex_lock_nest_lock = =20 From: Peter Zijlstra = =20 Date: Fri, 26 Nov 2010 15:39:00 +0100 = =20 = =20 In order to convert i_mmap_lock to a mutex we need a mutex equivalent = =20 to spin_lock_nest_lock(), thus provide the mutex_lock_nest_lock() = =20 annotation. = =20 = =20 As with spin_lock_nest_lock(), mutex_lock_nest_lock() allows = =20 annotation of the locking pattern where an outer lock serializes the = =20 acquisition order of nested locks. That is, if every time you lock = =20 multiple locks A, say A1 and A2 you first acquire N, the order of = =20 acquiring A1 and A2 is irrelevant. = =20 = =20 Signed-off-by: Peter Zijlstra =20 --- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from casper.infradead.org ([85.118.1.10]:45326 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707Ab1DTLFV convert rfc822-to-8bit (ORCPT ); Wed, 20 Apr 2011 07:05:21 -0400 Subject: Re: [PATCH 13/20] lockdep, mutex: Provide mutex_lock_nest_lock From: Peter Zijlstra In-Reply-To: <20110419130654.95a14117.akpm@linux-foundation.org> References: <20110401121258.211963744@chello.nl> <20110401121725.940769985@chello.nl> <20110419130654.95a14117.akpm@linux-foundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Date: Wed, 20 Apr 2011 13:03:56 +0200 Message-ID: <1303297436.8345.158.camel@twins> Mime-Version: 1.0 Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton Cc: Andrea Arcangeli , Avi Kivity , Thomas Gleixner , Rik van Riel , Ingo Molnar , Linus Torvalds , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, Benjamin Herrenschmidt , David Miller , Hugh Dickins , Mel Gorman , Nick Piggin , Paul McKenney , Yanmin Zhang Message-ID: <20110420110356.DiE_EDX2PWqxeSRy9H1C75DWmORVRsTkcSS9K7kq3Lw@z> On Tue, 2011-04-19 at 13:06 -0700, Andrew Morton wrote: > On Fri, 01 Apr 2011 14:13:11 +0200 > Peter Zijlstra wrote: > > > Provide the mutex_lock_nest_lock() annotation. > > why? > > Neither the changelog nor the code provide any documentation for this addition to > the lokdep API. --- Subject: lockdep, mutex: Provide mutex_lock_nest_lock From: Peter Zijlstra Date: Fri, 26 Nov 2010 15:39:00 +0100 In order to convert i_mmap_lock to a mutex we need a mutex equivalent to spin_lock_nest_lock(), thus provide the mutex_lock_nest_lock() annotation. As with spin_lock_nest_lock(), mutex_lock_nest_lock() allows annotation of the locking pattern where an outer lock serializes the acquisition order of nested locks. That is, if every time you lock multiple locks A, say A1 and A2 you first acquire N, the order of acquiring A1 and A2 is irrelevant. Signed-off-by: Peter Zijlstra ---