Subject: Re: Paul A Vixie: NetBSD/i386 1.2, 128MB, "mp_map full", help?
To: Paul A Vixie <paul@vix.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-i386
Date: 01/13/1997 00:23:25
On Sun, 12 Jan 1997 23:49:14 -0800 
 Paul A Vixie <paul@vix.com> wrote:

 > The result is a lot of panics like these:
 > 
 > 	panic: ptdi 1ba063
 > 	panic: malloc: out of space in kmem_map
 > 
 > Now, I don't know what the PTDI error means, but I gathered that the
 > kmem_map size was set to an odd constant involving 6*1024*1024/4096, so I
 > decided to see if something larger would work:
 > 
 > 	options		NKMEMCLUSTERS=4096
 > 
 > But with this set, the kernel does not even boot.  Right after telling me
 > how many bytes of main memory it found, I get a "panic: ptdi" and death.

Ok... this is due to running out of kernel page directory entries; you're
not able to map the entire kernel address space.  You can avoid this
lossage by setting the NKPDE constant (in i386/include/pmap.h) to
a higher value... the maximum useful value of this constant is 31.
I believe the default is 12... I'd suggest doubling that...

Sometime after 1.2 was released, the kernel was taught how to "guess"
a reasonable value for this at run-time.  On my 128M P6, the kernel
uses the max of 31 kpdes.  Hmm, so, if you're bumping up the kmem_map
size and/or mb_map size, you might want to use NKPDE == 31.

...hope that helps.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939