From 45443497d1b1837b0f507d85565636f50fa5cecf Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Tue, 11 Aug 2009 19:17:18 +0000 Subject: Do not bother initializing bufpages in the md code if the computation is exactly the same the mi could will use if bufinit() is invoked with bufpages == 0. --- sys/arch/alpha/alpha/machdep.c | 9 +-------- sys/arch/amd64/amd64/machdep.c | 9 +-------- sys/arch/arm/arm/arm32_machdep.c | 15 +-------------- sys/arch/aviion/aviion/machdep.c | 9 +-------- sys/arch/hp300/hp300/machdep.c | 9 +-------- sys/arch/hppa/hppa/machdep.c | 9 +-------- sys/arch/hppa64/hppa64/machdep.c | 9 +-------- sys/arch/luna88k/luna88k/machdep.c | 9 +-------- sys/arch/mac68k/mac68k/machdep.c | 9 +-------- sys/arch/macppc/macppc/machdep.c | 9 +-------- sys/arch/mvme68k/mvme68k/machdep.c | 9 +-------- sys/arch/mvme88k/mvme88k/machdep.c | 9 +-------- sys/arch/mvmeppc/mvmeppc/machdep.c | 9 +-------- sys/arch/sgi/sgi/machdep.c | 9 +-------- sys/arch/sh/sh/sh_machdep.c | 15 +-------------- sys/arch/socppc/socppc/machdep.c | 9 +-------- sys/arch/solbourne/solbourne/machdep.c | 9 +-------- sys/arch/sparc/sparc/machdep.c | 9 +-------- sys/arch/sparc64/sparc64/machdep.c | 9 +-------- sys/arch/vax/vax/machdep.c | 9 +-------- 20 files changed, 20 insertions(+), 172 deletions(-) diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 080c1fd9a72..57460e66997 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.119 2009/08/11 18:46:30 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.120 2009/08/11 19:17:14 miod Exp $ */ /* $NetBSD: machdep.c,v 1.210 2000/06/01 17:12:38 thorpej Exp $ */ /*- @@ -824,13 +824,6 @@ cpu_startup() ptoa((psize_t)unknownmem) / 1024 / 1024); } - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * Allocate a submap for exec arguments. This map effectively * limits the number of processes exec'ing at any time. diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index e3802e15839..d747347d756 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.100 2009/08/11 18:46:31 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.101 2009/08/11 19:17:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -306,13 +306,6 @@ cpu_startup(void) printf("real mem = %lu (%luMB)\n", ptoa((psize_t)physmem), ptoa((psize_t)physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * Allocate a submap for exec arguments. This map effectively * limits the number of processes exec'ing at any time. diff --git a/sys/arch/arm/arm/arm32_machdep.c b/sys/arch/arm/arm/arm32_machdep.c index bf035342094..21387977306 100644 --- a/sys/arch/arm/arm/arm32_machdep.c +++ b/sys/arch/arm/arm/arm32_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arm32_machdep.c,v 1.31 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: arm32_machdep.c,v 1.32 2009/08/11 19:17:16 miod Exp $ */ /* $NetBSD: arm32_machdep.c,v 1.42 2003/12/30 12:33:15 pk Exp $ */ /* @@ -285,19 +285,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - 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/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c index b0897a57c4e..85572c37a19 100644 --- a/sys/arch/aviion/aviion/machdep.c +++ b/sys/arch/aviion/aviion/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.32 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.33 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 2007 Miodrag Vallat. * @@ -270,13 +270,6 @@ cpu_startup() */ platform->startup(); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 7b633b7f487..9e7f020213f 100644 --- a/sys/arch/hp300/hp300/machdep.c +++ b/sys/arch/hp300/hp300/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.125 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.126 2009/08/11 19:17:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.121 1999/03/26 23:41:29 mycroft Exp $ */ /* @@ -267,13 +267,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 a8d372255c8..a20d756dede 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.177 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.178 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 1999-2003 Michael Shalayeff @@ -628,13 +628,6 @@ cpu_startup(void) ptoa(physmem) / 1024 / 1024); printf("rsvd mem = %u (%uKB)\n", ptoa(resvmem), ptoa(resvmem) / 1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 efab3f596b9..70cd7295598 100644 --- a/sys/arch/hppa64/hppa64/machdep.c +++ b/sys/arch/hppa64/hppa64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.18 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.19 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -380,13 +380,6 @@ cpu_startup(void) ptoa((psize_t)phsymem) / 1024 / 1024); printf("rsvd mem = %u (%uKB)\n", ptoa(resvmem), ptoa(resvmem) / 1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - printf("here3\n"); /* * Allocate a submap for exec arguments. This map effectively diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index 2726d4fa5bc..6565aa6bdf1 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.67 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.68 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -447,13 +447,6 @@ cpu_startup() if (obiova != OBIO_START) panic("obiova %lx: OBIO not free", obiova); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 8097b84fcec..384485b82aa 100644 --- a/sys/arch/mac68k/mac68k/machdep.c +++ b/sys/arch/mac68k/mac68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.152 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.153 2009/08/11 19:17:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.207 1998/07/08 04:39:34 thorpej Exp $ */ /* @@ -396,13 +396,6 @@ cpu_startup(void) printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 40a9a9e172f..1698a7b296a 100644 --- a/sys/arch/macppc/macppc/machdep.c +++ b/sys/arch/macppc/macppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.112 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.113 2009/08/11 19:17:16 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -485,13 +485,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 1c3282c1afd..c61381d1a69 100644 --- a/sys/arch/mvme68k/mvme68k/machdep.c +++ b/sys/arch/mvme68k/mvme68k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.119 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.120 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -242,13 +242,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 13f790cd9ba..9ae417ec3e5 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.234 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.235 2009/08/11 19:17:16 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -381,13 +381,6 @@ cpu_startup() #endif } - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 c5685002d6a..a998b943d4a 100644 --- a/sys/arch/mvmeppc/mvmeppc/machdep.c +++ b/sys/arch/mvmeppc/mvmeppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.61 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.62 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -391,13 +391,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 58bb0da8d5a..103754b6eba 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.80 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.81 2009/08/11 19:17:17 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -717,13 +717,6 @@ cpu_startup() printf("rsvd mem = %u (%uMB)\n", ptoa(rsvdmem), ptoa(rsvdmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * Allocate a submap for exec arguments. This map effectively * limits the number of processes exec'ing at any time. diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c index b6e19c2b170..9ab193ef8b4 100644 --- a/sys/arch/sh/sh/sh_machdep.c +++ b/sys/arch/sh/sh/sh_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sh_machdep.c,v 1.25 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: sh_machdep.c,v 1.26 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */ /* @@ -278,19 +278,6 @@ sh_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - 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 f1477e0ad49..e6001152602 100644 --- a/sys/arch/socppc/socppc/machdep.c +++ b/sys/arch/socppc/socppc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.17 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.18 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */ /* @@ -748,13 +748,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 48518fdb19d..92ed8df10e6 100644 --- a/sys/arch/solbourne/solbourne/machdep.c +++ b/sys/arch/solbourne/solbourne/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.13 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.14 2009/08/11 19:17:17 miod Exp $ */ /* OpenBSD: machdep.c,v 1.105 2005/04/11 15:13:01 deraadt Exp */ /* @@ -165,13 +165,6 @@ cpu_startup() printf("real mem = %d (%dMB)\n", ptoa(physmem), ptoa(physmem) / 1024 / 1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 5e0b5825ecf..3aba61d12dc 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.122 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.123 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -179,13 +179,6 @@ cpu_startup() printf("real mem = %u (%uMB)\n", ptoa(physmem), ptoa(physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * Allocate a submap for exec arguments. This map effectively * limits the number of processes exec'ing at any time. diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index cad2d0aff64..31454c8661d 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.120 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.121 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -237,13 +237,6 @@ cpu_startup() printf("real mem = %lu (%luMB)\n", ptoa((psize_t)physmem), ptoa((psize_t)physmem)/1024/1024); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * 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 5fccc2bec91..41e272548d5 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.105 2009/08/11 18:46:32 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.106 2009/08/11 19:17:17 miod Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -186,13 +186,6 @@ cpu_startup() mtpr(AST_NO, PR_ASTLVL); spl0(); - /* - * Determine how many buffers to allocate. - * We allocate bufcachepercent% of memory for buffer space. - */ - if (bufpages == 0) - bufpages = physmem * bufcachepercent / 100; - /* * Allocate a submap for exec arguments. This map effectively limits * the number of processes exec'ing at any time. -- cgit v1.2.3