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

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

John Baldwin writes:
 > 
 > On 22-Jan-2003 Andrew Gallatin wrote:
 > > 
 > > 
 > > 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.

Actually, I think we do it only for small mallocs where we go through
uma_zalloc{_arg}().  The case where size > KMEM_ZMAX does not
(immediately) go through uma_zalloc(), so I was was worried things
could sneek by.

I'd feel more comfortable if the check happened in malloc() itself, so
that both large and small cases got equal coverage.

Drew

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?15919.12136.371483.838009>