cvs commit: src/sys/vm vm_kern.c
des at des.no
Mon Feb 16 11:13:57 PST 2004
Robert Watson <rwatson at FreeBSD.org> writes:
> On Mon, 16 Feb 2004, Dag-Erling Smorgrav wrote:
> > Log:
> > Don't panic if we fail to satisfy an M_WAITOK request; return 0 instead.
> > The calling code will either handle that gracefully or cause a page fault.
> This substantially modifies the semantics of the two consumers of
> kmem_malloc(), and those semantic changes trickle up the stack to a number
> of important places. Are you going to update the consumers (and their
> comments) as well?
This can only happen if you request a ridiculously large allocation;
if you actually run out of memory (e.g. due to a leak) you will get
"out of swap space" or similar errors instead. There are several
cases in which kmem_malloc() would previously trigger "kmem_map too
small" even though the caller could recover gracefully if given half a
chance. Before this patch there was no incentive to fix those cases
because you'd never get a change to try to recover anyway.
Dag-Erling Smørgrav - des at des.no
More information about the cvs-src