Subject: Re: pondering NKMEMPAGES{_MAX}
To: John D. Baker <jdbaker@mylinuxisp.com>
From: Chuck Silvers <chuq@chuq.com>
List: port-sparc
Date: 01/13/2006 07:53:44
On Thu, Dec 01, 2005 at 11:25:31AM -0600, John D. Baker wrote:
> I've been pondering this problem since I've now been bitten by it more
> than a few times, and others have recently run up against it for the
> first time and are voicing some confusion over it.
> 
> I'd like to get it straight in my mind just what the issue is.  It seems
> to be this:  kmem_map is a block of descriptors that malloc() and friends
> use to point to chunks of memory that get allocated.  The problem comes
> about on large-memory systems where memory is available, but there are
> no more descriptors to point to it and malloc() fails.
> 
> Is this an accurate description?

kmem_map describes a region of kernel virtual address space that is
used for memory that can be allocated or freed in interrupt context.
when that virtual space is all used up but we still need more,
the kernel panics.

the size of this region is auto-tuned within the bounds of
NKMEMPAGES_{MIN,MAX}, which default to NKMEMPAGES_{MIN,MAX}_DEFAULT.

I checked in a change just now that increases the default upper bound
on this size to 32 MB, which should be plenty for large-memory sun4m boxes
and doesn't seem to cause problems for large-memory sun4c boxes.

-Chuck