Date: Mon, 16 Feb 2004 17:46:04 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: mux@FreeBSD.org Cc: des@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_kern.c Message-ID: <20040216.174604.89900183.imp@bsdimp.com> In-Reply-To: <20040216214602.GD35475@elvis.mu.org> References: <20040216210503.GC35475@elvis.mu.org> <20040216.142540.32721629.imp@bsdimp.com> <20040216214602.GD35475@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20040216214602.GD35475@elvis.mu.org>
Maxime Henrion <mux@FreeBSD.org> writes:
: > How would that be different than M_NOWAIT and then trying again a
: > couple of times? Each time will fail if it is too big. And that's
: > not meaningfully distinguishable from there not being enough memory
: > currently available to satisfy the request.
:
: Because if there is a memory shortage but it's possible to get the
: requested amount of memory later (because it's smaller than kmem_map),
: M_WAITOK | M_SAFE won't fail but wait while M_NOWAIT will fail right
: away. Why trying again when we already have a flag for this? What this
: patch does is allow to call malloc(verybignumber) without crashing to
: help in cases where it's hard to define what's a reasonable size.
It seems of dubious value then. If someone is going to call malloc
with a verybignumber by mistake, they are just as likely to neglect to
put M_SAFE in place.
Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040216.174604.89900183.imp>
