Re: panic on kldload

From:

Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>

Date:

Thu, 10 Jan 2008 14:47:40 -0800 (PST)

:hey,
:
:I just booted with hw.physmem=64m and got a panic when trying to load a module:
:
:panic: kld: malloc limit exceeded
:
:#3 0xc0182129 in kmalloc (size=78, type=0xc02f5600, flags=2)
: at /usr/build/src/sys/kern/kern_slaballoc.c:445
:#4 0xc01678b4 in linker_make_file (pathname=0xc641b000 "./nvidia.ko", priv=0xc63ea028,
: ops=0xc02f5bc8) at /usr/build/src/sys/kern/kern_linker.c:369
:...
:
:the problem seems to be that M_LINKER already used 10% of all memory (allegedly). In this case kmalloc() simply panics if passing M_WAITOK without M_NULLOK. This is quite unfortunate. Shouldn't we try to stay alive and print a warning and block, hoping that the problem will resolve itself?
:
:cheers
: simon
That's an administrative limit, it sounds like the solution is to simply
assign a reasonable minimum to it.
Well, what's the malloc limit when you have 64MB of ram? From gdb
do 'print M_LINKER'. And... is the amount of memory it thinks it is
using roughly similar to the amount of memory the loaded modules ought
to be taking up?
-Matt