Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Sep 2002 16:06:50 -0700
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Marc Recht <marc@informatik.uni-bremen.de>, current@FreeBSD.ORG
Subject:   Re: GEOM panic in current kernel
Message-ID:  <20020928160650.A80864@FreeBSD.org>
In-Reply-To: <3D960FE4.80E7CB24@mindspring.com>; from tlambert2@mindspring.com on Sat, Sep 28, 2002 at 01:24:04PM -0700
References:  <33985.1033238233@critter.freebsd.dk> <3D960745.1224A651@mindspring.com> <20020928130558.A72197@FreeBSD.org> <3D960FE4.80E7CB24@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* De: Terry Lambert <tlambert2@mindspring.com> [ Data: 2002-09-28 ]
	[ Subjecte: Re: GEOM panic in current kernel ]
> Juli Mallett wrote:
> > * De: Terry Lambert <tlambert2@mindspring.com> [ Data: 2002-09-28 ]
> > > Poul-Henning Kamp wrote:
> > > > +       bzero(&mymutex, sizeof mymutex);
> > > >         mtx_init(&mymutex, "g_up", MTX_DEF, 0);
> > >
> > >
> > > Too bad mtx_init() doesn't really initialize the mutex, or
> > > this would not be necessary.  8-(.
> > 
> > That would break some witness checks, Terry, which check for something very
> > bad, which shouldn't happen: a mutex actually being initialised twice.
> 
> The ones in this case are on the stack, which means that they
> are not going to persist long enough for that to be a problem.
> 
> For persistent mutexes, this implies that bzero()'ing is a bad
> thing to do (from a witness perspective), but a good thing to
> do otherwise.
> 
> What this all implies to me is that there needs to be a mutex
> allocation/deallocation mechanism for keeping witness happy,
> by verifying that the mutex is no longer used at the point
> that it is freed, so that it's OK to bzero() it on initial
> allocation (to differentiate initial allocation from reuse).
> 
> The point comes down to "where do little mutexes come from?".
> 
> Actually, it seems to me that it should be OK to initialize a
> mutex multiple times, and only not OK to initialize it if it's
> in use.  In other words, I don't think that the protection you
> are talking about is protecting against what it;s pretending to.

A mutex zone or pool, and actual allocation would be interesting.
-- 
Juli Mallett <jmallett@FreeBSD.org>       | FreeBSD: The Power To Serve
Will break world for fulltime employment. | finger jmallett@FreeBSD.org
http://people.FreeBSD.org/~jmallett/      | Support my FreeBSD hacking!

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020928160650.A80864>