Subject: Re: fdexpand() memory shortage check (Re: kern/14721)
To: Jaromir Dolecek <email@example.com>
From: Chuck Silvers <firstname.lastname@example.org>
Date: 12/17/2001 00:57:00
the way I read it, malloc(M_WAITOK) will panic rather than wait any time
the exhausted resource is virtual space in kmem_map rather than physical
pages. this can happen even if it's only trying to allocate one virtual
page, the allocation size being small just makes it less likely.
On Sat, Dec 15, 2001 at 11:15:42PM +0100, Jaromir Dolecek wrote:
> Chuck Silvers wrote:
> > the trouble I have with this M_CANFAIL flag is exactly the point that
> > you mention below: even if we can recover from the file-descriptor
> > allocation failure, kmem_map is still almost entirely full and so the
> > next malloc() call is likely to panic the machine anyway.
> Up to now, I though that only requests for clearly too big chunk
> would fail with M_WAITOK. i.e. even if most of kva is allocated/used,
> all the other malloc(9) calls with M_WAITOK would wait for the
> memory to become available, rather than fail (and panic).
> Is this not true?
> Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
> -= Those who would give up liberty for a little temporary safety deserve =-
> -= neither liberty nor safety, and will lose both. -- Benjamin Franklin =-