From owner-cvs-all Fri Oct 25 7: 0:54 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 84E2F37B404; Fri, 25 Oct 2002 07:00:52 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6715A43E3B; Fri, 25 Oct 2002 07:00:50 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id g9PE0krF018324; Fri, 25 Oct 2002 16:00:46 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: John Baldwin Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_mutex.c In-Reply-To: Your message of "Fri, 25 Oct 2002 09:50:53 EDT." Date: Fri, 25 Oct 2002 16:00:46 +0200 Message-ID: <18323.1035554446@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message , John Baldwin writes: > >On 25-Oct-2002 Poul-Henning Kamp wrote: >> phk 2002/10/25 01:40:20 PDT >> >> Modified files: >> sys/kern kern_mutex.c >> Log: >> Disable the kernacc() check in mtx_validate() until such time that kernacc >> does not require Giant. >> >> This means that we may miss panics on a class of mutex programming bugs, >> but only if running with a Chernobyl setting of debug-flags. >> >> Spotted by: Pete Carah > >People probably should not be using MUTEX_DEBUG unless they are actually >working on the mutex implementation anyways. We might even should just >shoot that code in the head and put it out of its misery. Maybe replace it by: { struct mtx tmp; [...] /* See if we can read/write the mutex */ bcopy(mp, &tmp, sizeof tmp); bcopy(&tmp, mp, sizeof tmp); If we want to retain some amount of checking. Poul-Henning PS: That reminds me, I've sometimes wondered if we should have a global string pointer where one could leave a panic hint, that could make the above code look something like: { struct mtx tmp; [...] /* See if we can read/write the mutex */ panic_hint("Mutex in wrong kind of RAM"); bcopy(mp, &tmp, sizeof tmp); bcopy(&tmp, mp, sizeof tmp); panic_hint(NULL); And if explode on one of the bcopy() panic would leave a hint about what the problem is: panic(blablabla) This may be why: Mutex in wrong kind of RAM. Hint from: mtx_validate() line 886 in ../../../kern/kern_mutex.c Just an idea... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message