Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2007 10:08:44 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        Darren Reed <darrenr@freebsd.org>, Kris Kennaway <kris@FreeBSD.org>, freebsd-current@freebsd.org, Larry Rosenman <ler@lerctr.org>
Subject:   Re: panic: kmem_malloc(131072): kmem_map too small (AMD64)
Message-ID:  <84E9AA30-96B5-4517-B43E-0AC98550639D@mac.com>
In-Reply-To: <86zlz8zlyv.fsf@ds4.des.no>
References:  <20070921102946.T11189@borg> <46F415BF.9010500@FreeBSD.org> <20070921140550.D96923@thebighonker.lerctr.org> <46F41CFF.6080108@FreeBSD.org> <46F58799.1030702@freebsd.org> <46F58B21.8030307@FreeBSD.org> <20070924091558.GB32006@team.vega.ru> <46F78C59.1020801@FreeBSD.org> <20070924080347.O84223@thebighonker.lerctr.org> <20070924144210.GA82735@team.vega.ru> <46F7D7A4.5090007@samsco.org> <46F80A39.3050707@FreeBSD.org> <46F8951C.50904@freebsd.org> <46F8CE67.60206@FreeBSD.org> <46FA2E46.8020303@freebsd.org> <FDD4BD60-E7C8-4864-A6F5-F749304F3FF5@mac.com> <86zlz8zlyv.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sep 26, 2007, at 11:00 PM, Dag-Erling Sm=F8rgrav wrote:
> Chuck Swiger <cswiger@mac.com> writes:
>> I'm not certain whether FreeBSD's kernel memory allocator [malloc(9),
>> zone(9)] even supports the notion of allocating pageable memory
>> rather than memory taken from the fixed KVA region.  The manpage
>> implies that calling kernel malloc with M_WAITOK will always return a
>> valid pointer and not NULL, but I'm not convinced this is will be
>> true if you try allocating something larger than the size of KVA and/
>> or the amount of physical RAM available in the system.
>
> malloc(M_WAITOK) will panic if the request is not satisfiable.  =20
> Where do
> you think "kmem_map too small" comes from?

Indeed-- an excellent point that would be nifty to find in the docs:

--- src/share/man/man9/malloc.9~   2005-02-22 12:20:20.000000000 -0500
+++ src/share/man/man9/malloc.9    2007-09-27 13:00:36.000000000 -0400
@@ -289,7 +289,9 @@
.Dv NULL
if the request could not be satisfied (implying that
.Dv M_NOWAIT
-was set).
+was set).  However, if
+.Dv M_WAITOK
+is set and the request could not be satisfied, the kernel will panic.
.Sh DIAGNOSTICS
A kernel compiled with the
.Dv INVARIANTS

...?

--=20
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84E9AA30-96B5-4517-B43E-0AC98550639D>