summaryrefslogtreecommitdiffstats
path: root/sys/pc98/i386
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-08-23 01:30:51 +0000
committerpeter <peter@FreeBSD.org>2001-08-23 01:30:51 +0000
commitbaeea019edcb2de95c903ddc7f3f929a4343ce2e (patch)
tree8c846ba41b93f0c1b356e02f9e2c3d9340ec7071 /sys/pc98/i386
parentc5420ad0cd0fb582cf959d0f0e91b579cb8e7c87 (diff)
downloadFreeBSD-src-baeea019edcb2de95c903ddc7f3f929a4343ce2e.zip
FreeBSD-src-baeea019edcb2de95c903ddc7f3f929a4343ce2e.tar.gz
Merge i386/machdep.c rev 1.470. Limit KVM for buffer cache etc.
Forgotten by: dillon
Diffstat (limited to 'sys/pc98/i386')
-rw-r--r--sys/pc98/i386/machdep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 698a770..c983c7c 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -311,7 +311,9 @@ again:
* The nominal buffer size (and minimum KVA allocation) is BKVASIZE.
* For the first 64MB of ram nominally allocate sufficient buffers to
* cover 1/4 of our ram. Beyond the first 64MB allocate additional
- * buffers to cover 1/20 of our ram over 64MB.
+ * buffers to cover 1/20 of our ram over 64MB. When auto-sizing
+ * the buffer cache we limit the eventual kva reservation to
+ * maxbcache bytes.
*
* factor represents the 1/4 x ram conversion.
*/
@@ -323,6 +325,9 @@ again:
nbuf += min((physmem_est - 1024) / factor, 16384 / factor);
if (physmem_est > 16384)
nbuf += (physmem_est - 16384) * 2 / (factor * 5);
+
+ if (maxbcache && nbuf > physmem_est / BKVASIZE)
+ nbuf = maxbcache / BKVASIZE;
}
/*
OpenPOWER on IntegriCloud