summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-10-25 08:34:50 +0000
committerdg <dg@FreeBSD.org>1994-10-25 08:34:50 +0000
commit5dc52e1f1e779f727b7767bdd562bd303db3df62 (patch)
tree87a54b436e71baf7e418fece4ab76fae9e7dbefa
parentce24706799ca18bc401f503cd7145cf0b08b969e (diff)
downloadFreeBSD-src-5dc52e1f1e779f727b7767bdd562bd303db3df62.zip
FreeBSD-src-5dc52e1f1e779f727b7767bdd562bd303db3df62.tar.gz
Restricted maximum bufpages to 1500; this is required for machines >64MB
of memory to work without running out of kernel VM (and increasing it to even more than it is now (96MB) is out of the question. Changed bufpages calculation to allocation a little less bufer cache (16% of mem-2MB instead of 20%); this is simply a better figure for most systems.
-rw-r--r--sys/amd64/amd64/machdep.c9
-rw-r--r--sys/i386/i386/machdep.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 2dac4d8..eb5b18c 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.77 1994/10/19 00:05:59 wollman Exp $
+ * $Id: machdep.c,v 1.78 1994/10/20 00:07:49 phk Exp $
*/
#include "npx.h"
@@ -258,16 +258,15 @@ again:
* We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/
if (bufpages == 0)
- bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 5;
+ bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 6;
if (bufpages < 64)
bufpages = 64;
/*
* We must still limit the maximum number of buffers to be no
- * more than 2/5's of the size of the kernal malloc region, this
- * will only take effect for machines with lots of memory
+ * more than 750 because we'll run out of kernel VM otherwise.
*/
- bufpages = min(bufpages, (VM_KMEM_SIZE / NBPG) * 2 / 5);
+ bufpages = min(bufpages, 1500);
if (nbuf == 0) {
nbuf = bufpages / 2;
if (nbuf < 32)
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 2dac4d8..eb5b18c 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.77 1994/10/19 00:05:59 wollman Exp $
+ * $Id: machdep.c,v 1.78 1994/10/20 00:07:49 phk Exp $
*/
#include "npx.h"
@@ -258,16 +258,15 @@ again:
* We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/
if (bufpages == 0)
- bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 5;
+ bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 6;
if (bufpages < 64)
bufpages = 64;
/*
* We must still limit the maximum number of buffers to be no
- * more than 2/5's of the size of the kernal malloc region, this
- * will only take effect for machines with lots of memory
+ * more than 750 because we'll run out of kernel VM otherwise.
*/
- bufpages = min(bufpages, (VM_KMEM_SIZE / NBPG) * 2 / 5);
+ bufpages = min(bufpages, 1500);
if (nbuf == 0) {
nbuf = bufpages / 2;
if (nbuf < 32)
OpenPOWER on IntegriCloud