Subject: Re: 4G memory
To: None <itojun@iijlab.net>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 08/20/2002 23:13:34
On Wed, Aug 21, 2002 at 07:17:27AM +0900, itojun@iijlab.net wrote:
> >>         are there anything that has to be done to run NetBSD 1.6E/i386
> >>         with 4G memory?  my colleague says that it goes to DDB from UVM
> >>         (yes, i need to get backtrace).
> >Decrease BUFPAGES down to a sane number.  I use
> >options BUFPAGES=0x1000
> 
> 	could we somehow automate this?  like below (not sure if it is
> 	entirely correct, since i'm touching MI code):

You should be aware that limiting BUFPAGES, and thus NBUF, will seriously
hurt your filesystem performance on a machine like the ftp (== rsync) or
cvs/anoncvs server, because it limits how many directories the machine
can cache.

The best thing to do is probably to reduce MAXBSIZE, possibly all the way
to 8k but certainly to 32k or 16k, so that you can have as many buffers
as possible.  It's NBUF that eats all the VA space; the use of PA space
for BUFPAGES is not actually the problem.

We run nbanoncvs with BUFPAGES=16384 and NBUF=16384 and MAXBSIZE 32768.
If I had not foolishly built filesystems with a 32K blocksize, we could
reduce MAXBSIZE further and thus increase NBUF/BUFPAGES.  If you are
installing a new machine for use as a CVS or FTP server for the project,
it would be wise to use 8k/1k or 16k/2k filesystems, and MAXBSIZE of
16k or 8k, allowing NBUF/BUFPAGES of 32768 or 65536.  That way you can
cache all the directory entries for the NetBSD source tree and not hit
the disk, as nbanoncvs is forced to sometimes even with 3.5GB of RAM.

You can lie to newfs about the disk geometry when you install the machine
and thus get an 8k blocksize even if you could not do so with the disklabel
geometry.  This can make installing a nuisance, but on a large-memory
machine with many directories in its filesystem, until we manage to fix
the buffer-cache allocator, it is worth doing.

Thor