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.
This commit is contained in:
dg 1994-10-25 08:34:50 +00:00
parent fcb39bbe43
commit b2b133f873
2 changed files with 8 additions and 10 deletions

View File

@ -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 @@ cpu_startup()
* 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)

View File

@ -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 @@ cpu_startup()
* 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)