From owner-cvs-all Mon Sep 9 8:56:13 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF03037B401; Mon, 9 Sep 2002 08:56:01 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B66E43E65; Mon, 9 Sep 2002 08:56:01 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.4/8.12.4) with SMTP id g89FteOo053835; Mon, 9 Sep 2002 11:55:40 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 9 Sep 2002 11:55:39 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: John Baldwin Cc: "Greg 'groggy' Lehey" , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_mutex.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 9 Sep 2002, John Baldwin wrote: > On 08-Sep-2002 Greg 'groggy' Lehey wrote: > > On Tuesday, 3 September 2002 at 11:25:16 -0700, John Baldwin wrote: > >> jhb 2002/09/03 11:25:16 PDT > >> > >> Modified files: > >> sys/kern kern_mutex.c > >> Log: > >> Add some KASSERT()'s to ensure that we don't perform spin mutex ops on > >> sleep mutexes and vice versa. WITNESS normally should catch this but > >> not everyone uses WITNESS so this is a fallback to catch nasty but easy > >> to do bugs. > > > > Is this a temporary thing which will go away, or is it dependent on > > some other debugging option? It doesn't seem to be something that > > should remain in production systems for ever. > > Hmm, well, for developer's it is very useful. WITNESS unfortunately > doesn't seem to catch the cases when it happens (I think the damage is > usually done too late by that point). ATM it is just a simple == > comparison with perhaps two pointer dereferences, not really a very > expensive check. #ifdef INVARIANTS /* The option is always available */ #define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0) #else #define KASSERT(exp,msg) #endif All KASSERT's are compiled out of kernels without INVARIANTS turned on. This won't affect production systems unless they have INVARIANTS explicitly turned on; I think that should handle grog's concerns? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message