diff options
author | dyson <dyson@FreeBSD.org> | 1996-11-17 02:11:01 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-11-17 02:11:01 +0000 |
commit | 20b553ba68ba8998038524a15f305a33c733a2b4 (patch) | |
tree | 0b1ec94660e67cf839df1a5900b4c27ff8f7338d /sys | |
parent | 3e98936b7c414beccaaa35e788432dba0eedba8a (diff) | |
download | FreeBSD-src-20b553ba68ba8998038524a15f305a33c733a2b4.zip FreeBSD-src-20b553ba68ba8998038524a15f305a33c733a2b4.tar.gz |
Improve the caching of small files like directories, while not
substantially increasing buffer space. Specifically, we double
the number of buffers, but allocate only half the amount of memory
per buffer. Note that VDIR files aren't cached unless instantiated
in a buffer. This will significantly improve caching.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 6082eec..0746c66 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.210 1996/11/07 14:43:59 joerg Exp $ + * $Id: machdep.c,v 1.211 1996/11/11 20:38:52 bde Exp $ */ #include "npx.h" @@ -282,9 +282,9 @@ again: if (nbuf == 0) { nbuf = 30; if( physmem > 1024) - nbuf += min((physmem - 1024) / 12, 1024); + nbuf += min((physmem - 1024) / 6, 2048); } - nswbuf = min(nbuf, 128); + nswbuf = max(min(nbuf/4, 128), 16); valloc(swbuf, struct buf, nswbuf); valloc(buf, struct buf, nbuf); diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 6082eec..0746c66 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.210 1996/11/07 14:43:59 joerg Exp $ + * $Id: machdep.c,v 1.211 1996/11/11 20:38:52 bde Exp $ */ #include "npx.h" @@ -282,9 +282,9 @@ again: if (nbuf == 0) { nbuf = 30; if( physmem > 1024) - nbuf += min((physmem - 1024) / 12, 1024); + nbuf += min((physmem - 1024) / 6, 2048); } - nswbuf = min(nbuf, 128); + nswbuf = max(min(nbuf/4, 128), 16); valloc(swbuf, struct buf, nswbuf); valloc(buf, struct buf, nbuf); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index f931f6d..8b27a28 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -18,7 +18,7 @@ * 5. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.103 1996/10/06 07:50:05 dyson Exp $ + * $Id: vfs_bio.c,v 1.104 1996/10/17 03:04:43 dyson Exp $ */ /* @@ -155,7 +155,7 @@ bufinit() * cache is still the same as it would be for 8K filesystems. This * keeps the size of the buffer cache "in check" for big block filesystems. */ - maxbufspace = 2 * (nbuf + 8) * PAGE_SIZE; + maxbufspace = (nbuf + 8) * PAGE_SIZE; /* * reserve 1/3 of the buffers for metadata (VDIR) which might not be VMIO'ed */ |