diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 1997-08-30 09:50:29 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 1997-08-30 09:50:29 +0000 |
commit | 2a645167024c88bc5a5f770cdebaeed9585be0fc (patch) | |
tree | 39657b948d9099980fae3510085ae94d90e1526f /sys/arch/vax | |
parent | f6e8c1d661334b3a49f0ca247fb8937cdadb9458 (diff) |
Since the previous one died...
Some code to get my MV3600 to work. -moj
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/include/vmparam.h | 5 | ||||
-rw-r--r-- | sys/arch/vax/vax/machdep.c | 36 |
2 files changed, 29 insertions, 12 deletions
diff --git a/sys/arch/vax/include/vmparam.h b/sys/arch/vax/include/vmparam.h index 8f6ee8b81e9..e8c5ca98c01 100644 --- a/sys/arch/vax/include/vmparam.h +++ b/sys/arch/vax/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.5 1997/05/29 00:04:56 niklas Exp $ */ +/* $OpenBSD: vmparam.h,v 1.6 1997/08/30 09:50:26 maja Exp $ */ /* $NetBSD: vmparam.h,v 1.12 1996/07/20 17:58:26 ragge Exp $ */ /*- @@ -181,8 +181,7 @@ #define VM_MAXUSER_ADDRESS ((vm_offset_t)0x7FFFE000) #define VM_MAX_ADDRESS ((vm_offset_t)0xC0000000) #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0x80000000) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)(VM_MIN_KERNEL_ADDRESS+\ - (VM_KERNEL_PT_PAGES*0x10000))) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0x90000000) /* virtual sizes (bytes) for various kernel submaps */ #define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 9904d58fcbc..c9f14e09a14 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.13 1997/07/23 06:58:31 denny Exp $ */ +/* $OpenBSD: machdep.c,v 1.14 1997/08/30 09:50:28 maja Exp $ */ /* $NetBSD: machdep.c,v 1.35 1997/01/11 11:31:26 ragge Exp $ */ /* @@ -320,21 +320,39 @@ allocsys(v) valloc(msqids, struct msqid_ds, msginfo.msgmni); #endif +#ifndef BUFCACHEPERCENT +#define BUFCACHEPERCENT 5 +#endif /* - * Determine how many buffers to allocate (enough to hold 5% of total - * physical memory, but at least 16). Allocate 1/2 as many swap - * buffer headers as file i/o buffers. + * Determine how many buffers to allocate. By default we allocate + * the BSD standard of use 10% of memory for the first 2 Meg, + * 5% of remaining. But this might cause systems with large + * core (32MB) to fail to boot due to small KVM space. Reduce + * BUFCACHEPERCENT in this case. + * Insure a minimum of 16 buffers. + * Allocate 1/2 as many swap buffer headers as file i/o buffers. */ - if (bufpages == 0) - if (physmem < btoc(2 * 1024 * 1024)) - bufpages = (physmem / 10) / CLSIZE; - else - bufpages = (physmem / 20) / CLSIZE; + if (bufpages == 0) { + /* We always have more than 2MB of memory. */ + bufpages = (btoc(2 * 1024 * 1024) + physmem) / + ((100/BUFCACHEPERCENT) * CLSIZE); + } if (nbuf == 0) { nbuf = bufpages; if (nbuf < 16) nbuf = 16; } + /* Restrict to at most 70% filled kvm */ +#ifdef 0 + 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; +#endif + + /* More buffer pages than fits into the buffer is senseless. */ + if (bufpages > nbuf * MAXBSIZE / CLBYTES) + bufpages = nbuf * MAXBSIZE / CLBYTES; if (nswbuf == 0) { nswbuf = (nbuf / 2) & ~1; /* force even */ if (nswbuf > 256) |