On Wed, 23 Oct 2002 16:44:06 +1000 (EST),
  Bruce Evans <[EMAIL PROTECTED]> said:

bde> I should be the last to defend the current design and implementation of
bde> the buffer cache, since I think it gets almost everything wrong (the
bde> implementation is OK, but has vast complications to work around design
bde> errors), but I think buffer_map is one of the things that it gets right
bde> (if we're going to have buffers at all).
(snip)
bde> I use the following changes in -current to enlarge the buffer cache and
bde> avoid fragmentation.  These only work because I don't have much physical
bde> memory (512MB max).  Even i386's have enough vm for the pure form of
bde> buffer_map to work:
bde> - enlarge BKVASIZE to MAXBSIZE so that fragmentation can not (should not?)
bde>   occur.
bde> - enlarge nbuf by a factor of (my_BKVASIZE / current_BKVASIZE) to work
bde>   around bugs.  The point of BKVASIZE got lost somewhere.
bde> - enlarge nbuf and associated variables by another factor of 2 or 4 to
bde>   get a larger buffer cache.
bde> This is marginal for 512MB physical, and probably wouldn't work if I had
bde> a lot of mbufs.  nbuf is about 4000 and buffer_map takes about 256MB.
bde> 256MB is a lot, but nbuf = 4000 isn't a lot.  I used buffer caches
bde> with 2000 * 1K buffers under Minix and Linux before FreeBSD, and ISTR
bde> having an nbuf of 5000 or so in FreeBSD-1.1.  At least 2880 buffers are
bde> needed to properly cache a tiny 1.44MB floppy with an msdosfs file
bde> system with a block size of 512, and that was an important test case.

bde> End of FreeBSD-[2-5] history.

Incidentally, Solaris 7 on sun4u reserves a space of 256MB in the KVM
according to Solaris Internals.  On i386 (x86), the size is only 4MB.
Not sure whether they use those spaces in a pure form, or they cluster
some consecutive pages (which leads to fragmentation), though...

NetBSD UBC also makes a map dedicated to buffers in kernel_map.

Maybe there is a point to have a map dedicated to the buffer space for
a better stability, and the size of the buffer map could be much
smaller than now.  During my testing, I found that only up to 6-7MB of
the buffers out of 40-50MB were wired down (ie busy, locked for
background write or dirty) at most.

-- 
Seigo Tanimura <[EMAIL PROTECTED]>

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to