Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 7 Aug 2002 17:41:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 7 Aug 2002 17:41:00 -0400 Received: from garrincha.netbank.com.br ([200.203.199.88]:28947 "HELO garrincha.netbank.com.br") by vger.kernel.org with SMTP id ; Wed, 7 Aug 2002 17:40:59 -0400 Date: Wed, 7 Aug 2002 18:44:23 -0300 (BRT) From: Rik van Riel X-X-Sender: riel@imladris.surriel.com To: Jesse Barnes cc: linux-kernel@vger.kernel.org, , , Subject: Re: [PATCH] lock assertion macros for 2.5.30 In-Reply-To: <20020807213949.GA27258@sgi.com> Message-ID: X-spambait: aardvark@kernelnewbies.org X-spammeplease: aardvark@nl.linux.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1339 Lines: 42 On Wed, 7 Aug 2002, Jesse Barnes wrote: > > The MUST_NOT_HOLD basically means the kernel will OOPS the > > moment the lock is contended. > > I think those macros were intended to enforce lock ordering in the > scsi layer (though I'm not sure). If you can prove that a MUST_NOT_HOLD(foolock) will never trigger because it is already protected by other locks, then what's the point of having that foolock in the first place ? (since the region is already protected...) If the foolock is actually protecting something, then by definition lock contention is possible and the kernel will Oops in MUST_NOT_HOLD(foolock). > > If you want to detect lock recursion on the same CPU, I'd > > suggest the following: > > ... > > Of course, that's what the lockmetering code does, IIRC, but I think > that's a feature for a seperate patch. Agreed. Btw, the MUST_HOLD macro _is_ straightforward and extremely useful. IMHO it'd be a shame to have only the SCSI code use it ;) regards, Rik -- Bravely reimplemented by the knights who say "NIH". http://www.surriel.com/ http://distro.conectiva.com/ - 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/