aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-08-23 01:30:51 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-08-23 01:30:51 +0000
commit748e7247a189fb5562236ec49a92f759fd2d8db2 (patch)
tree8c846ba41b93f0c1b356e02f9e2c3d9340ec7071
parent9f9360003f29686af25b3b4b27a3d2377fec8f53 (diff)
downloadsrc-748e7247a189fb5562236ec49a92f759fd2d8db2.tar.gz
src-748e7247a189fb5562236ec49a92f759fd2d8db2.zip
Merge i386/machdep.c rev 1.470. Limit KVM for buffer cache etc.
Forgotten by: dillon
Notes
Notes: svn path=/head/; revision=82158
-rw-r--r--sys/pc98/i386/machdep.c7
-rw-r--r--sys/pc98/pc98/machdep.c7
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 698a770c5680..c983c7c6c196 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;
}
/*
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 698a770c5680..c983c7c6c196 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/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;
}
/*