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.
This commit is contained in:
dyson 1996-11-17 02:11:01 +00:00
parent 3e98936b7c
commit 20b553ba68
3 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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
*/