diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-01 11:02:12 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-01 11:02:12 +0000 |
commit | bd8e2883dc73960cd3e30c0dff751a46b7a53feb (patch) | |
tree | f0c92e2a3a14b66c825ea0bc7719871f890ebacb | |
parent | 04e80f5117ad97f18f7735f449da1eca9705b195 (diff) |
Allow bufpages/nbuf larger than 1 (still max out at all buffers
be MAXBSIZE). Remove faulty limit test of buffer pages allocation. The
check is now done at the bufpages+nbuf calculations.
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 938f4ee72c5..0db30c9afcd 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -194,9 +194,9 @@ cpu_startup() base = bufpages / nbuf; residual = bufpages % nbuf; - if (base >= MAXBSIZE) { + if (base >= MAXBSIZE / CLBYTES) { /* don't want to alloc more physical mem than needed */ - base = MAXBSIZE; + base = MAXBSIZE / CLBYTES; residual = 0; } @@ -335,17 +335,20 @@ allocsys(v) if (bufpages == 0) bufpages = (physmem / ((100/BUFCACHEPERCENT) / CLSIZE)); /* Restrict to at most 70% filled kvm */ - if (bufpages * MAXBSIZE > - (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10) - bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / - MAXBSIZE * 7 / 10; if (nbuf == 0) { nbuf = bufpages; if (nbuf < 16) nbuf = 16; } - if (nbuf > 200) /* XXX Sorry, our kvm space is too small */ - nbuf = 200; + if (nbuf * MAXBSIZE > + (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10) + nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / + MAXBSIZE * 7 / 10; + + /* More buffer pages than fits into the buffers is senseless. */ + if (bufpages > nbuf * MAXBSIZE / CLBYTES) + bufpages = nbuf * MAXBSIZE / CLBYTES; + if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) |