Subject: Re: Virtual Memory Issues on 2.0
To: NetBSD/sparc Discussion List <port-sparc@NetBSD.ORG>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: port-sparc
Date: 01/13/2005 12:55:17
On Thu, Jan 13, 2005 at 02:30:31AM -0500, Greg A. Woods wrote:
> [ On Wednesday, January 12, 2005 at 10:58:16 (+0100), Manuel Bouyer wrote: ]
> > Subject: Re: Virtual Memory Issues on 2.0
> >
> > I don't know from where the 6095 comes ...
> 
> I was going to suggest that if you didn't actually use "options
> NKMEMPAGES" as you thought then it would have been auto-configured to
> 1/4 of physmem, but that can't be right either since the default minimum
> is 6MB too.

Here is what I have in my config file:
options NKMEMPAGES_MAX="8192"   #32M

> From sys/arch/sparc/include/param.h:
> 
> 
> /*
>  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
>  * logical pages.
>  */
> #define NKMEMPAGES_MIN_DEFAULT  ((6 * 1024 * 1024) >> PAGE_SHIFT)
> #define NKMEMPAGES_MAX_DEFAULT  ((6 * 1024 * 1024) >> PAGE_SHIFT)
> 
> 
> (see also sys/kern/kern_malloc.c:kmeminit_nkmempages() and the related
> #ifdefs near the top of the same file of course)
> 
> 
> So if you had defined NKMEMPAGES then that should be the exact value
> that it stays at, but if you had not then it should always be exactly
> 6MB.
> 
> 
> On my 128MB desktop machine the 8146 comes from the 1/4 physmem rule:
> 
> hw.physmem = 133468160
> 
> 133468160 / 4 / 4096 = 8146

It seems my 6095 comes from here:
hw.physmem = 99860480
99860480 / 4 / 4096 = 6095

but them it seems that NKMEMPAGES_MIN_DEFAULT isn't respected.
The other strange thing is that I clearly remember adding the
NKMEMPAGES_MAX option to my kernel config file, because without it
the kernel wouln't even boot with raidframe. Maybe it was before
NKMEMPAGES_*_DEFAULT was changed.
Same thing for the sparc IPC I have at home, I had to add NKMEMPAGES_MAX=3072,
because it would otherwise panic at boot.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--