Subject: 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 03:23:20
I guess I'm just missing something.  The only real knowledge I have of the
i386 MMU comes from a couple of books next to my desk, but it leaves me
scratching my head as to why there are so many problems when the number
of certain things in the kernel get large, notably SYSV SHM pages and buffers.

Please stop and correct me at the point below where I'm wrong.  I must be
wrong somewhere.

NKPDE specifies the number of page directory entries -- page tables --
reserved for use by the kernel, right?

(Question: what is the negative consequence of making NKPDE much larger than
 it is?  The number of PDE's used by the kernel should be much smaller than
 the number used by user pages, shouldn't it?)

Each of these page tables gives you 4K pages, right?  That's 4K * 4K = 16MB of
address space, right?

So with NKPDE=12, the kernel has 12 * 16MB = 192MB of address space to play
with.

Now, I'm looking at machdep.c, where the map for buffers is allocated.
It's allocating MAXBSIZE (64K) * NBUF (currently set as nbuf = bufpages; that
is, assuming a minimum buffer size of a page, use enough buffers to allow all
of the memory in the buffer cache to be used, right?) worth of address space.

Similar code occurs in a number of other places.  Isn't this just wrong?

Thor