diff options
author | Mats O Jansson <maja@cvs.openbsd.org> | 2002-02-17 22:59:54 +0000 |
---|---|---|
committer | Mats O Jansson <maja@cvs.openbsd.org> | 2002-02-17 22:59:54 +0000 |
commit | 7beb673ee2a6f26cb92ffbcee12d36dd3f705fd8 (patch) | |
tree | f241a99972126accf4f3a3e5afc119bb3b5e7109 /sys/arch/sparc | |
parent | e59357f842efb4b5301b194970688e1d2da24d97 (diff) |
Patch from Daniel Lucq <daniel@lucq.org>
The patch allows you to change the value of NMBCLUSTERS, BUFCACHEPERCENT
and NKMEMPAGES using the config command, instead of recompiling the kernel.
This is the kernel part of the patch. I have compiled it on i386, sparc64,
alpha and macppc. -moj ok art@ maja@
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 3 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index 15e06e9ad4c..20feed1b633 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.22 2001/12/19 08:58:05 art Exp $ */ +/* $OpenBSD: vmparam.h,v 1.23 2002/02/17 22:59:53 maja Exp $ */ /* $NetBSD: vmparam.h,v 1.13 1997/07/12 16:20:03 perry Exp $ */ /* @@ -108,7 +108,6 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xfe000000) /* virtual sizes (bytes) for various kernel submaps */ -#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES) #define VM_KMEM_SIZE (NKMEMCLUSTERS*PAGE_SIZE) #define VM_PHYSSEG_MAX 32 /* we only have one "hole" */ diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 177e5d5f7b3..bd33985c129 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.78 2002/01/23 17:51:52 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.79 2002/02/17 22:59:53 maja Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -120,11 +120,17 @@ int nbuf = NBUF; #else int nbuf = 0; #endif + +#ifndef BUFCACHEPERCENT +#define BUFCACHEPERCENT 5 +#endif + #ifdef BUFPAGES int bufpages = BUFPAGES; #else int bufpages = 0; #endif +int bufcachepercent = BUFCACHEPERCENT; int physmem; @@ -317,16 +323,13 @@ 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. */ if (bufpages == 0) - bufpages = physmem * BUFCACHEPERCENT / 100; + bufpages = physmem * bufcachepercent / 100; if (nbuf == 0) { nbuf = bufpages; if (nbuf < 16) |