summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2009-06-15 17:01:27 +0000
committerBob Beck <beck@cvs.openbsd.org>2009-06-15 17:01:27 +0000
commit2ad23154352bb286faa9d4e90c688c5bea78c525 (patch)
tree74d852efc8530c595f03e7c280d4b345659b6e3e /sys/arch
parent53a176b4ab49f0631c3e478055286d9e4e625d32 (diff)
Back out all the buffer cache changes I committed during c2k9. This reverts three
commits: 1) The sysctl allowing bufcachepercent to be changed at boot time. 2) The change moving the buffer cache hash chains to a red-black tree 3) The dynamic buffer cache (Which depended on the earlier too). ok on the backout from marco and todd
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/machdep.c8
-rw-r--r--sys/arch/aviion/aviion/machdep.c8
-rw-r--r--sys/arch/hp300/hp300/machdep.c8
-rw-r--r--sys/arch/hppa/hppa/machdep.c8
-rw-r--r--sys/arch/hppa64/hppa64/machdep.c8
-rw-r--r--sys/arch/i386/i386/machdep.c7
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c8
-rw-r--r--sys/arch/mac68k/mac68k/machdep.c8
-rw-r--r--sys/arch/macppc/macppc/machdep.c8
-rw-r--r--sys/arch/mvme68k/mvme68k/machdep.c8
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c8
-rw-r--r--sys/arch/mvmeppc/mvmeppc/machdep.c8
-rw-r--r--sys/arch/sgi/sgi/machdep.c8
-rw-r--r--sys/arch/socppc/socppc/machdep.c8
-rw-r--r--sys/arch/solbourne/solbourne/machdep.c8
-rw-r--r--sys/arch/sparc/sparc/machdep.c8
-rw-r--r--sys/arch/vax/vax/machdep.c8
17 files changed, 118 insertions, 17 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 4631a8f8c3e..bb3c8e97c59 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.95 2009/06/14 03:04:07 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.96 2009/06/15 17:01:25 beck Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -399,6 +399,12 @@ setup_buffers()
*/
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
}
/*
diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c
index 3b8237656c5..ebff8ba9465 100644
--- a/sys/arch/aviion/aviion/machdep.c
+++ b/sys/arch/aviion/aviion/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.28 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.29 2009/06/15 17:01:25 beck Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
*
@@ -293,6 +293,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/hp300/hp300/machdep.c b/sys/arch/hp300/hp300/machdep.c
index d560a1b7c58..c4b391071c6 100644
--- a/sys/arch/hp300/hp300/machdep.c
+++ b/sys/arch/hp300/hp300/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.121 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.122 2009/06/15 17:01:25 beck Exp $ */
/* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */
/*
@@ -290,6 +290,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index f7c0af3f823..843dac586e3 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.172 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.173 2009/06/15 17:01:25 beck Exp $ */
/*
* Copyright (c) 1999-2003 Michael Shalayeff
@@ -653,6 +653,12 @@ cpu_startup(void)
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/hppa64/hppa64/machdep.c b/sys/arch/hppa64/hppa64/machdep.c
index e3385e60162..33a408a7a02 100644
--- a/sys/arch/hppa64/hppa64/machdep.c
+++ b/sys/arch/hppa64/hppa64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.14 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.15 2009/06/15 17:01:25 beck Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -406,6 +406,12 @@ cpu_startup(void)
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
printf("here3\n");
/*
* Allocate a submap for exec arguments. This map effectively
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index ad3a266aa0f..2969cc3413c 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.452 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.453 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -547,6 +547,11 @@ setup_buffers()
if (bufpages == 0)
bufpages = atop(avail_end) * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
}
/*
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index 27a6f7ae066..03281cec0cb 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.63 2009/06/03 21:30:19 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.64 2009/06/15 17:01:26 beck Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -470,6 +470,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/mac68k/mac68k/machdep.c b/sys/arch/mac68k/mac68k/machdep.c
index a86c163e416..9f992582dca 100644
--- a/sys/arch/mac68k/mac68k/machdep.c
+++ b/sys/arch/mac68k/mac68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.148 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.149 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */
/*
@@ -419,6 +419,12 @@ cpu_startup(void)
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/macppc/macppc/machdep.c b/sys/arch/macppc/macppc/machdep.c
index 0a3a0b876e4..ab9e2862361 100644
--- a/sys/arch/macppc/macppc/machdep.c
+++ b/sys/arch/macppc/macppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.107 2009/06/09 01:12:38 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.108 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -509,6 +509,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/mvme68k/mvme68k/machdep.c b/sys/arch/mvme68k/mvme68k/machdep.c
index 836bec8ec95..db6c36898db 100644
--- a/sys/arch/mvme68k/mvme68k/machdep.c
+++ b/sys/arch/mvme68k/mvme68k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.115 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.116 2009/06/15 17:01:26 beck Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -265,6 +265,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 32c28247423..063acd72a66 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.230 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.231 2009/06/15 17:01:26 beck Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -404,6 +404,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c
index 42da01b655a..a2432cce471 100644
--- a/sys/arch/mvmeppc/mvmeppc/machdep.c
+++ b/sys/arch/mvmeppc/mvmeppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.57 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.58 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -415,6 +415,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index c44bd038eec..f296ef4b2b8 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.73 2009/06/13 21:48:03 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.74 2009/06/15 17:01:26 beck Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -768,6 +768,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm. */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/socppc/socppc/machdep.c b/sys/arch/socppc/socppc/machdep.c
index f1da92fde61..fc2a738d51b 100644
--- a/sys/arch/socppc/socppc/machdep.c
+++ b/sys/arch/socppc/socppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.12 2009/06/09 01:12:38 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.13 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -772,6 +772,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/solbourne/solbourne/machdep.c b/sys/arch/solbourne/solbourne/machdep.c
index cc3e64cf9a7..0c90df97b4d 100644
--- a/sys/arch/solbourne/solbourne/machdep.c
+++ b/sys/arch/solbourne/solbourne/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.9 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.10 2009/06/15 17:01:26 beck Exp $ */
/* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */
/*
@@ -190,6 +190,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c
index ea63610774f..e1a7178feea 100644
--- a/sys/arch/sparc/sparc/machdep.c
+++ b/sys/arch/sparc/sparc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.117 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.118 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */
/*
@@ -203,6 +203,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively
* limits the number of processes exec'ing at any time.
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index fd9433bcbba..21aba9fe1d3 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.100 2009/06/03 21:30:20 beck Exp $ */
+/* $OpenBSD: machdep.c,v 1.101 2009/06/15 17:01:26 beck Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -212,6 +212,12 @@ cpu_startup()
if (bufpages == 0)
bufpages = physmem * bufcachepercent / 100;
+ /* Restrict to at most 25% filled kvm */
+ if (bufpages >
+ (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / PAGE_SIZE / 4)
+ bufpages = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) /
+ PAGE_SIZE / 4;
+
/*
* Allocate a submap for exec arguments. This map effectively limits
* the number of processes exec'ing at any time.