summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/alpha/alpha/machdep.c13
-rw-r--r--sys/arch/alpha/include/vmparam.h3
-rw-r--r--sys/arch/amiga/include/vmparam.h3
-rw-r--r--sys/arch/hp300/include/vmparam.h3
-rw-r--r--sys/arch/hppa/hppa/machdep.c13
-rw-r--r--sys/arch/hppa/include/vmparam.h3
-rw-r--r--sys/arch/i386/i386/machdep.c13
-rw-r--r--sys/arch/i386/include/vmparam.h3
-rw-r--r--sys/arch/mac68k/include/vmparam.h3
-rw-r--r--sys/arch/macppc/include/vmparam.h3
-rw-r--r--sys/arch/macppc/macppc/machdep.c13
-rw-r--r--sys/arch/mvme68k/include/vmparam.h3
-rw-r--r--sys/arch/mvme88k/include/vmparam.h3
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c13
-rw-r--r--sys/arch/mvmeppc/include/vmparam.h3
-rw-r--r--sys/arch/mvmeppc/mvmeppc/machdep.c13
-rw-r--r--sys/arch/sparc/include/vmparam.h3
-rw-r--r--sys/arch/sparc/sparc/machdep.c13
-rw-r--r--sys/arch/sparc64/include/vmparam.h4
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c13
-rw-r--r--sys/arch/sun3/include/vmparam.h3
-rw-r--r--sys/arch/sun3/sun3/machdep.c12
-rw-r--r--sys/arch/vax/include/vmparam.h4
-rw-r--r--sys/arch/vax/vax/machdep.c5
-rw-r--r--sys/conf/param.c4
-rw-r--r--sys/kern/uipc_mbuf.c6
-rw-r--r--sys/sys/mbuf.h4
27 files changed, 95 insertions, 84 deletions
diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c
index ed29ed9df75..87cb5564e14 100644
--- a/sys/arch/alpha/alpha/machdep.c
+++ b/sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.65 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.66 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */
/*-
@@ -142,11 +142,17 @@ int nbuf = NBUF;
#else
int nbuf = 0;
#endif
+
+#ifndef BUFCACHEPERCENT
+#define BUFCACHEPERCENT 10
+#endif
+
#ifdef BUFPAGES
int bufpages = BUFPAGES;
#else
int bufpages = 0;
#endif
+int bufcachepercent = BUFCACHEPERCENT;
struct vm_map *exec_map = NULL;
struct vm_map *phys_map = NULL;
@@ -815,16 +821,13 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 10
-#endif
/*
* Determine how many buffers to allocate.
* We allocate 10% of memory for buffer space. Insure a
* minimum of 16 buffers.
*/
if (bufpages == 0)
- bufpages = (physmem / (100/BUFCACHEPERCENT));
+ bufpages = (physmem / (100/bufcachepercent));
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
diff --git a/sys/arch/alpha/include/vmparam.h b/sys/arch/alpha/include/vmparam.h
index e83e985e334..4afae8f0eaf 100644
--- a/sys/arch/alpha/include/vmparam.h
+++ b/sys/arch/alpha/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.9 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.10 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2000/05/22 17:13:54 thorpej Exp $ */
/*
@@ -122,7 +122,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)ALPHA_K1SEG_END)
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*NBPG)
/* some Alpha-specific constants */
diff --git a/sys/arch/amiga/include/vmparam.h b/sys/arch/amiga/include/vmparam.h
index fd88dcc6a6a..c1d23d962c6 100644
--- a/sys/arch/amiga/include/vmparam.h
+++ b/sys/arch/amiga/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.18 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.19 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.16 1997/07/12 16:18:36 perry Exp $ */
/*
@@ -129,7 +129,6 @@
/*
* virtual sizes (bytes) for various kernel submaps
*/
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
#define VM_PHYSSEG_MAX (16)
diff --git a/sys/arch/hp300/include/vmparam.h b/sys/arch/hp300/include/vmparam.h
index 4c948a19242..d2f157e5b8e 100644
--- a/sys/arch/hp300/include/vmparam.h
+++ b/sys/arch/hp300/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.11 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.12 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.16 1998/08/20 08:33:48 kleink Exp $ */
/*
@@ -136,7 +136,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xFFFFF000)
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
/* # of kernel PT pages (initial only, can grow dynamically) */
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 7ec6d28d17f..92bc59add0d 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.58 2002/02/12 06:42:26 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.59 2002/02/17 22:59:52 maja Exp $ */
/*
* Copyright (c) 1999-2002 Michael Shalayeff
@@ -100,11 +100,17 @@ int nbuf = NBUF;
#else
int nbuf = 0;
#endif
+
+#ifndef BUFCACHEPERCENT
+#define BUFCACHEPERCENT 10
+#endif /* BUFCACHEPERCENT */
+
#ifdef BUFPAGES
int bufpages = BUFPAGES;
#else
int bufpages = 0;
#endif
+int bufcachepercent = BUFCACHEPERCENT;
/*
* Different kinds of flags used throughout the kernel.
@@ -456,12 +462,9 @@ hppa_init(start)
*/
/* buffer cache parameters */
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 10
-#endif /* BUFCACHEPERCENT */
if (bufpages == 0)
bufpages = totalphysmem / 100 *
- (totalphysmem <= 0x1000? 5 : BUFCACHEPERCENT);
+ (totalphysmem <= 0x1000? 5 : bufcachepercent);
if (nbuf == 0)
nbuf = bufpages < 16? 16 : bufpages;
diff --git a/sys/arch/hppa/include/vmparam.h b/sys/arch/hppa/include/vmparam.h
index e9de27d3a50..22992486c53 100644
--- a/sys/arch/hppa/include/vmparam.h
+++ b/sys/arch/hppa/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.20 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.21 2002/02/17 22:59:52 maja Exp $ */
/*
* Copyright (c) 1988-1994, The University of Utah and
@@ -92,7 +92,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)0xf0000000)
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
#define VM_PHYSSEG_MAX 8 /* this many physmem segments */
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index e4d95a93984..9773b403d34 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.196 2002/01/28 23:14:24 mickey Exp $ */
+/* $OpenBSD: machdep.c,v 1.197 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -211,11 +211,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;
extern int boothowto;
int physmem;
@@ -479,9 +485,6 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 5
-#endif
/*
* Determine how many buffers to allocate. We use 10% of the
* first 2MB of memory, and 5% of the rest, with a minimum of 16
@@ -493,7 +496,7 @@ allocsys(v)
bufpages = physmem / 10;
else
bufpages = (btoc(2 * 1024 * 1024) + physmem) *
- BUFCACHEPERCENT / 100;
+ bufcachepercent / 100;
}
if (nbuf == 0) {
nbuf = bufpages;
diff --git a/sys/arch/i386/include/vmparam.h b/sys/arch/i386/include/vmparam.h
index 65de391767f..29e4e4d689b 100644
--- a/sys/arch/i386/include/vmparam.h
+++ b/sys/arch/i386/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.23 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.24 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.15 1994/10/27 04:16:34 cgd Exp $ */
/*-
@@ -111,7 +111,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)(APTDPTDI<<PDSHIFT))
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
#define VM_PHYSSEG_MAX 4 /* actually we could have this many segments */
diff --git a/sys/arch/mac68k/include/vmparam.h b/sys/arch/mac68k/include/vmparam.h
index c3492dc85d8..f54720df5a5 100644
--- a/sys/arch/mac68k/include/vmparam.h
+++ b/sys/arch/mac68k/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.12 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.13 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.8 1996/11/15 14:21:00 briggs Exp $ */
/*
@@ -157,7 +157,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)(0-NBPG))
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
/* # of kernel PT pages (initial only, can grow dynamically) */
diff --git a/sys/arch/macppc/include/vmparam.h b/sys/arch/macppc/include/vmparam.h
index 1460bce56d6..b29dead31f4 100644
--- a/sys/arch/macppc/include/vmparam.h
+++ b/sys/arch/macppc/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.7 2002/01/07 05:31:27 drahn Exp $ */
+/* $OpenBSD: vmparam.h,v 1.8 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */
/*-
@@ -97,7 +97,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)((KERNEL_SR << ADDR_SR_SHFT) \
+ VM_KERN_ADDRESS_SIZE))
-#define VM_MBUF_SIZE (NMBCLUSTERS * PAGE_SIZE)
#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE)
#define __HAVE_PMAP_PHYSSEG
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index d3fd5bf8291..c0d39b92c43 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.24 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.25 2002/02/17 22:59:52 maja Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -113,11 +113,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;
struct bat battable[16];
@@ -634,14 +640,11 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 5
-#endif
/*
* Decide on buffer space to use.
*/
if (bufpages == 0)
- bufpages = physmem * BUFCACHEPERCENT / 100;
+ bufpages = physmem * bufcachepercent / 100;
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
diff --git a/sys/arch/mvme68k/include/vmparam.h b/sys/arch/mvme68k/include/vmparam.h
index 843cddff371..2ec1c7d96fe 100644
--- a/sys/arch/mvme68k/include/vmparam.h
+++ b/sys/arch/mvme68k/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.12 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.13 2002/02/17 22:59:53 maja Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -131,7 +131,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFF000)
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
/* # of kernel PT pages (initial only, can grow dynamically) */
diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h
index 4e8882be664..99dbe816ac9 100644
--- a/sys/arch/mvme88k/include/vmparam.h
+++ b/sys/arch/mvme88k/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.19 2001/12/24 04:12:37 miod Exp $ */
+/* $OpenBSD: vmparam.h,v 1.20 2002/02/17 22:59:53 maja Exp $ */
/*
* Mach Operating System
* Copyright (c) 1992 Carnegie Mellon University
@@ -90,7 +90,6 @@
#define INTSTACK_SIZE (3 * PAGE_SIZE) /* interrupt stack size */
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS * MCLBYTES)
#define VM_PHYS_SIZE (1 * NPTEPG * PAGE_SIZE)
/*
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 302cbb04d29..8db7c28d268 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.88 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.89 2002/02/17 22:59:53 maja Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -210,11 +210,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;
caddr_t allocsys __P((caddr_t));
@@ -714,9 +720,6 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 5
-#endif
/*
* Determine how many buffers to allocate. We use 10% of the
* first 2MB of memory, and 5% of the rest, with a minimum of 16
@@ -728,7 +731,7 @@ allocsys(v)
bufpages = physmem / 10;
else
bufpages = (btoc(2 * 1024 * 1024) + physmem) *
- BUFCACHEPERCENT / 100;
+ bufcachepercent / 100;
}
if (nbuf == 0) {
nbuf = bufpages;
diff --git a/sys/arch/mvmeppc/include/vmparam.h b/sys/arch/mvmeppc/include/vmparam.h
index 3ec13e54aef..fb40fb98c50 100644
--- a/sys/arch/mvmeppc/include/vmparam.h
+++ b/sys/arch/mvmeppc/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.8 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.9 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.1 1996/09/30 16:34:38 ws Exp $ */
/*-
@@ -98,7 +98,6 @@ extern vm_offset_t ppc_kvm_size;
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)((KERNEL_SR << ADDR_SR_SHFT) \
+ SEGMENT_LENGTH))
-#define VM_MBUF_SIZE (NMBCLUSTERS * PAGE_SIZE)
#define VM_PHYS_SIZE (USRIOSIZE * PAGE_SIZE)
#define __HAVE_PMAP_PHYSSEG
diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c
index 4a016f9b9b8..8a1b130ded0 100644
--- a/sys/arch/mvmeppc/mvmeppc/machdep.c
+++ b/sys/arch/mvmeppc/mvmeppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.20 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.21 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -124,11 +124,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;
struct bat battable[16];
@@ -604,14 +610,11 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 5
-#endif
/*
* Decide on buffer space to use.
*/
if (bufpages == 0)
- bufpages = physmem * BUFCACHEPERCENT / 100;
+ bufpages = physmem * bufcachepercent / 100;
if (nbuf == 0) {
nbuf = bufpages;
if (nbuf < 16)
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)
diff --git a/sys/arch/sparc64/include/vmparam.h b/sys/arch/sparc64/include/vmparam.h
index c790d9b071c..8889e84b2ce 100644
--- a/sys/arch/sparc64/include/vmparam.h
+++ b/sys/arch/sparc64/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.6 2002/02/11 01:23:36 deraadt Exp $ */
+/* $OpenBSD: vmparam.h,v 1.7 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.18 2001/05/01 02:19:19 thorpej Exp $ */
/*
@@ -152,8 +152,6 @@
#define VM_MIN_KERNEL_ADDRESS ((vaddr_t)KERNBASE)
#define VM_MAX_KERNEL_ADDRESS ((vaddr_t)KERNEND)
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
-
#define VM_PHYSSEG_MAX 32 /* up to 32 segments */
#define VM_PHYSSEG_STRAT VM_PSTRAT_BSEARCH
#define VM_PHYSSEG_NOADD /* can't add RAM after vm_mem_init */
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 2d17378419b..a00794e8b53 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.34 2002/02/05 18:34:39 jason Exp $ */
+/* $OpenBSD: machdep.c,v 1.35 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -150,6 +150,12 @@ int bus_space_debug = 0; /* This may be used by macros elsewhere. */
struct vm_map *exec_map = NULL;
extern vaddr_t avail_end;
+#ifndef BUFCACHEPERCENT
+#define BUFCACHEPERCENT 5
+#endif
+
+int bufcachepercent = BUFCACHEPERCENT;
+
int physmem;
u_long _randseed;
extern caddr_t msgbufaddr;
@@ -358,16 +364,13 @@ allocsys(caddr_t 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)
diff --git a/sys/arch/sun3/include/vmparam.h b/sys/arch/sun3/include/vmparam.h
index 1245f46419a..78616964d7a 100644
--- a/sys/arch/sun3/include/vmparam.h
+++ b/sys/arch/sun3/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.10 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.11 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.14 1995/09/26 04:02:10 gwr Exp $ */
/*
@@ -134,7 +134,6 @@
#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0x0FE00000)
/* virtual sizes (bytes) for various kernel submaps */
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
#define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
#define VM_PHYSSEG_MAX 4
diff --git a/sys/arch/sun3/sun3/machdep.c b/sys/arch/sun3/sun3/machdep.c
index 09f075f3515..00c3a9ebb93 100644
--- a/sys/arch/sun3/sun3/machdep.c
+++ b/sys/arch/sun3/sun3/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.50 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.51 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: machdep.c,v 1.77 1996/10/13 03:47:51 christos Exp $ */
/*
@@ -110,6 +110,10 @@ struct vm_map *phys_map = NULL;
*/
int safepri = PSL_LOWIPL;
+#ifndef BUFCACHEPERCENT
+#define BUFCACHEPERCENT 5
+#endif
+
/*
* Declare these as initialized data so we can patch them.
*/
@@ -123,6 +127,7 @@ int bufpages = BUFPAGES;
#else
int bufpages = 0;
#endif
+int bufcachepercent = BUFCACHEPERCENT;
static caddr_t allocsys __P((caddr_t));
static void identifycpu __P((void));
@@ -195,9 +200,6 @@ allocsys(v)
valloc(msqids, struct msqid_ds, msginfo.msgmni);
#endif
-#ifndef BUFCACHEPERCENT
-#define BUFCACHEPERCENT 5
-#endif
/*
* Determine how many buffers to allocate. By default we allocate
* the BSD standard of use 10% of memory for the first 2 Meg,
@@ -210,7 +212,7 @@ allocsys(v)
if (bufpages == 0) {
/* We always have more than 2MB of memory. */
bufpages = (btoc(2 * 1024 * 1024) + physmem) *
- BUFCACHEPERCENT / 100;
+ bufcachepercent / 100;
}
if (nbuf == 0) {
nbuf = bufpages;
diff --git a/sys/arch/vax/include/vmparam.h b/sys/arch/vax/include/vmparam.h
index 39f77ec8a69..c038e833830 100644
--- a/sys/arch/vax/include/vmparam.h
+++ b/sys/arch/vax/include/vmparam.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmparam.h,v 1.17 2001/12/05 16:25:44 art Exp $ */
+/* $OpenBSD: vmparam.h,v 1.18 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: vmparam.h,v 1.32 2000/03/07 00:05:59 matt Exp $ */
/*-
@@ -131,6 +131,4 @@ struct pmap_physseg {
#define USRIOSIZE (8 * VAX_NPTEPG) /* 512MB */
#define VM_PHYS_SIZE (USRIOSIZE*VAX_NBPG)
-#define VM_MBUF_SIZE (NMBCLUSTERS*MCLBYTES)
-
#endif
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index bac6402564c..3c5ef44b619 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.52 2002/01/23 17:51:52 art Exp $ */
+/* $OpenBSD: machdep.c,v 1.53 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -137,6 +137,7 @@ int bufpages = BUFPAGES;
#else
int bufpages = 0;
#endif
+int bufcachepercent = BUFCACHEPERCENT;
extern int *chrtoblktbl;
extern int virtual_avail, virtual_end;
@@ -809,7 +810,7 @@ allocsys(v)
bufpages = physmem / 10;
else
bufpages = (btoc(2 * 1024 * 1024) + physmem) *
- BUFCACHEPERCENT / 100;
+ bufcachepercent / 100;
}
if (nbuf == 0)
nbuf = bufpages < 16 ? 16 : bufpages;
diff --git a/sys/conf/param.c b/sys/conf/param.c
index 29756059d04..91ab5dda828 100644
--- a/sys/conf/param.c
+++ b/sys/conf/param.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.c,v 1.17 2001/11/09 15:25:55 art Exp $ */
+/* $OpenBSD: param.c,v 1.18 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */
/*
@@ -92,7 +92,7 @@ int maxproc = NPROC;
#define NVNODE (NPROC * 2 + NTEXT + 100)
int desiredvnodes = NVNODE;
int maxfiles = 3 * (NPROC + MAXUSERS) + 80;
-int nmbclusters = NMBCLUSTERS;
+int nmbclust = NMBCLUSTERS;
#ifndef MBLOWAT
#define MBLOWAT 16
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 45cb3624086..6a913bb0e98 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.54 2002/02/05 22:06:43 angelos Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.55 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -117,7 +117,7 @@ mbinit()
vaddr_t minaddr, maxaddr;
mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
- VM_MBUF_SIZE, VM_MAP_INTRSAFE, FALSE, NULL);
+ nmbclust*(MCLBYTES), VM_MAP_INTRSAFE, FALSE, NULL);
pool_init(&mbpool, MSIZE, 0, 0, 0, "mbpl", NULL);
pool_init(&mclpool, MCLBYTES, 0, 0, 0, "mclpl", &mclpool_allocator);
@@ -130,7 +130,7 @@ mbinit()
* mbuf clusters the kernel is to support. Log the limit
* reached message max once a minute.
*/
- pool_sethardlimit(&mclpool, nmbclusters, mclpool_warnmsg, 60);
+ pool_sethardlimit(&mclpool, nmbclust, mclpool_warnmsg, 60);
/*
* Set a low water mark for both mbufs and clusters. This should
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 9bd619b1ea2..34e90da93da 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.56 2002/01/25 15:50:23 art Exp $ */
+/* $OpenBSD: mbuf.h,v 1.57 2002/02/17 22:59:53 maja Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -529,7 +529,7 @@ struct mbstat {
#ifdef _KERNEL
struct mbstat mbstat;
-extern int nmbclusters; /* limit on the # of clusters */
+extern int nmbclust; /* limit on the # of clusters */
extern int mblowat; /* mbuf low water mark */
extern int mcllowat; /* mbuf cluster low water mark */
int max_linkhdr; /* largest link-level header */