From owner-freebsd-current Fri May 31 0: 5:11 2002 Delivered-To: freebsd-current@freebsd.org Received: from tesla.distributel.net (nat.MTL.distributel.NET [66.38.181.24]) by hub.freebsd.org (Postfix) with ESMTP id 0074337B414 for ; Fri, 31 May 2002 00:04:04 -0700 (PDT) Received: (from bmilekic@localhost) by tesla.distributel.net (8.11.6/8.11.6) id g4TD8IB61101; Wed, 29 May 2002 09:08:18 -0400 (EDT) (envelope-from bmilekic@unixdaemons.com) Date: Wed, 29 May 2002 09:08:18 -0400 From: Bosko Milekic To: Terry Lambert Cc: Poul-Henning Kamp , Peter Wemm , Richard Wenninger , current@FreeBSD.ORG Subject: Re: UMA lock Message-ID: <20020529090818.A61073@unixdaemons.com> References: <10399.1022653079@critter.freebsd.dk> <3CF476E7.D465D5C3@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3CF476E7.D465D5C3@mindspring.com>; from tlambert2@mindspring.com on Tue, May 28, 2002 at 11:36:23PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, May 28, 2002 at 11:36:23PM -0700, Terry Lambert wrote: > Poul-Henning Kamp wrote: > > In message <20020529061540.88CD6380A@overcee.wemm.org>, Peter Wemm writes: > > >As you said, _sleeping_ is the problem. M_WAITOK means "you may sleep if > > >you like". ie: it is a time bomb waiting for the right low memory condition > > >which will then explode with a 100% authentic crash or lock up. > > > > > >Pretend it said M_SLEEPOK instead of M_WAITOK. > > > > Uhm, I'm actually seeing the opposite behaviour as well: after I > > changed the md(4) driver to use M_NOWAIT I still see malloc/zalloc > > sleeping... > > I'm with Poul on this one, Peter: M_WAITOK doesn't mean what > you think it means: it's doesn't mean tsleep may be called, > and M_NOWAIT doesn't mean tsleep() _won't_ be called, in > practice. With the same amount of time you spent typing up this Email, you could have checked the code and seen that M_WAITOK _does_ mean that tsleep may be called and that, in effect, M_NOWAIT means that tsleep will not be called. If we have cases where tsleep is called and are M_NOWAIT, then that's not good. M_NOWAIT means: "only allowed to block on a mutex." > It's either incredibly badly named, or it's incredibly badly > implemented -- I would argue the latter, actually, since even > if it's completely orthogonal, you're screwed because it means > you have two call conversion systems, without a WITNESS > intersection to detect deadly embraces. 8-(. > > -- Terry -- Bosko Milekic bmilekic@unixdaemons.com bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message