Subject: Re: Sparseness of kernel structures on i386?
To: None <port-i386@NetBSD.ORG>
From: Thor Lancelot Simon <tls@panix.com>
List: port-i386
Date: 12/08/1996 06:33:26
So, a number of people were kind enough to point out to me that 32 bits is
four bytes.  I knew I shouldn't ever start anything at 2AM. :-)

The only question I have left is this:  Why is NKPDE_MAX 32?  I've been told
on several occasions that you don't want more kernel PDE's than you need, but
I don't really have a firm grasp of why, except that it diminishes the total
amount of VA space available to user processes.  Aside from that, why
shouldn't NKPDE_MAX be, say, 512?

Theo was kind enough to point out to me that OpenBSD has the following code in
machdep.c, which would seem easy enough to pick up:

        /* Restrict to at most 70% filled kvm */
        if (bufpages * MAXBSIZE * 7 / 10 >
            (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS))
                bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
                    MAXBSIZE * 7 / 10;

But since we set nkpde from physmem at boot time, why oughtn't we simply do
the reverse, taking into account all of the submaps?

Thor