Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2003 16:58:05 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        arch@FreeBSD.ORG
Subject:   Re: M_ flags summary.
Message-ID:  <XFMail.20030122165805.jhb@FreeBSD.org>
In-Reply-To: <15919.4208.394911.712558@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

On 22-Jan-2003 Andrew Gallatin wrote:
> 
> 
> Speaking as the token 3rd party driver vendor, the removal of
> M_WAITOK/M_TRYWAIT is irritating, but not something that can't be
> solved with yet another ifdef in my driver.  Breaking the 5.0 ABI
> prior to 5.1 is no big deal to me, as I don't plan to support
> 5.0-RELEASE anyway, so I don't care what the #defines end up as in the
> 5.0-STABLE branch.
> 
> My thoughts are that whether we pronounce it po-ta-to, or po-tat-o,
> its still a potato and how its pronounced doesn't matter nearly as
> much as how it tastes.  
> 
> The taste "problem" here is that it always used to be safe to sleep
> in a process context.  That's not true anymore.  Now its safe to
> sleep in a process context if you're not holding any mutexes.  So
> there are pleny of sleepable allocation bugs lurking.
> 
> If we want to catch sleepable allocation bugs right up front, I
> suggest we put this:
> 
> if (!(flags & M_NOWAIT)) {
>    WITNESS_SLEEP(1, NULL);
> }
> 
> at the top of malloc, and at the top of all entry points to the mbuf
> allocator.  Eg, before the system has a chance to pull the allocation 
> off of some cache which will succeed 99.5% of the time, except when
> the system is under memory pressure.

We already do this for malloc(), that is the source of most of the
'could sleep' messages these days.  I have some patches I need to
commit to make the actual message more informative so that it will
say 'could malloc' etc.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

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




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