Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762322AbYHDTcX (ORCPT ); Mon, 4 Aug 2008 15:32:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757465AbYHDTcP (ORCPT ); Mon, 4 Aug 2008 15:32:15 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:51749 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754402AbYHDTcO (ORCPT ); Mon, 4 Aug 2008 15:32:14 -0400 Date: Mon, 4 Aug 2008 12:31:22 -0700 (PDT) From: Linus Torvalds To: Jeremy Fitzhardinge cc: Peter Zijlstra , David Miller , hugh@veritas.com, mingo@elte.hu, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, davej@redhat.com Subject: Re: [RFC][PATCH 7/7] lockdep: spin_lock_nest_lock() In-Reply-To: <489757EC.3000309@goop.org> Message-ID: References: <20080804130317.994042639@chello.nl> <20080804131012.246115111@chello.nl> <48974512.7000206@goop.org> <1217876046.3589.61.camel@twins> <489757EC.3000309@goop.org> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 858 Lines: 22 On Mon, 4 Aug 2008, Jeremy Fitzhardinge wrote: > > OK. I don't actually need to do this, but I was asking for completeness. But > to clarify, you only need to do the reverse unlock if you do it after > unlocking the outer lock? If you're still holding the outer lock, you can > unlock in any order? Release order should always be totally irrelevant, whether you hold outer locks or not. Only the order of _getting_ locks matter. And yes, if there is an outer lock, even the order of getting locks is irrelevant, as long as anybody who gets more than one inner lock always holds the outer one. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/