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:
David Greenman 1994-10-25 08:34:50 +00:00
parent d061325a87
commit 1b55c5bc85
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3844
2 changed files with 8 additions and 10 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * 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" #include "npx.h"
@ -258,16 +258,15 @@ cpu_startup()
* We allocate 1/2 as many swap buffer headers as file i/o buffers. * We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/ */
if (bufpages == 0) if (bufpages == 0)
bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 5; bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 6;
if (bufpages < 64) if (bufpages < 64)
bufpages = 64; bufpages = 64;
/* /*
* We must still limit the maximum number of buffers to be no * 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 * more than 750 because we'll run out of kernel VM otherwise.
* will only take effect for machines with lots of memory
*/ */
bufpages = min(bufpages, (VM_KMEM_SIZE / NBPG) * 2 / 5); bufpages = min(bufpages, 1500);
if (nbuf == 0) { if (nbuf == 0) {
nbuf = bufpages / 2; nbuf = bufpages / 2;
if (nbuf < 32) if (nbuf < 32)

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * 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" #include "npx.h"
@ -258,16 +258,15 @@ cpu_startup()
* We allocate 1/2 as many swap buffer headers as file i/o buffers. * We allocate 1/2 as many swap buffer headers as file i/o buffers.
*/ */
if (bufpages == 0) if (bufpages == 0)
bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 5; bufpages = ((physmem << PGSHIFT) - 2048*1024) / NBPG / 6;
if (bufpages < 64) if (bufpages < 64)
bufpages = 64; bufpages = 64;
/* /*
* We must still limit the maximum number of buffers to be no * 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 * more than 750 because we'll run out of kernel VM otherwise.
* will only take effect for machines with lots of memory
*/ */
bufpages = min(bufpages, (VM_KMEM_SIZE / NBPG) * 2 / 5); bufpages = min(bufpages, 1500);
if (nbuf == 0) { if (nbuf == 0) {
nbuf = bufpages / 2; nbuf = bufpages / 2;
if (nbuf < 32) if (nbuf < 32)