Subject: Re: Sparseness of kernel structures on i386?
To: Chris G Demetriou <Chris_G_Demetriou@auchentoshan.pdl.cs.cmu.edu>
From: John S. Dyson <toor@dyson.iquest.net>
List: port-i386
Date: 12/08/1996 13:04:51
> 
> > Let's say you have a machine with 128MB of memory.  That machine ends up with
> > NKPDE = 32; KPDE_BASE (1) + KPDE_MAX (31).  That's 32 * 16MB or 512MB of space
> > for kernel maps.  An eighth of the total amount of memory the machine can
> > address at all, in fact.
> 
> You've misunderstood the way nkpde is set.
> 
> It's min(NKPDE_BASE + NKPDE_SCALE(# of MB of extended memory), NKPDE_MAX).
> 
> It is not, and apparently cannot be, more than 31.  (I asked charles,
> that was his answer, i don't know why it's 31 as opposed to 32, which
> is what i'd expect based on the fact that the kernel currently lives
> in 128MB of virtual space at the top of the i386's virtual address
> range.)
> 
The alternate page directory (used so that things like the pagedaemon can
get access to the page tables of other processes -- necessary for freeing
pages), is I believe the reason for the one-less than expected number of
kernel page table pages in NetBSD-X86.  (That IS the reason in FreeBSD.)
The alternate page directory mappings are at the top of the kernel virtual
space.

John
dyson@freebsd.org