From owner-freebsd-stable@FreeBSD.ORG Tue Dec 28 22:50:28 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60856106566C; Tue, 28 Dec 2010 22:50:28 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 2DEA28FC0C; Tue, 28 Dec 2010 22:50:28 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id oBSMoQ6D075260 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 28 Dec 2010 14:50:26 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id oBSMoQR6075259; Tue, 28 Dec 2010 14:50:26 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA20705; Tue, 28 Dec 10 14:31:39 PST Date: Tue, 28 Dec 2010 14:31:39 -0800 From: perryh@pluto.rain.com To: avg@freebsd.org Message-Id: <4d1a654b.9/lZDQOjHY0hJCjq%perryh@pluto.rain.com> References: <4cfc72a5.3nAjkv8mdrO/NrKQ%perryh@pluto.rain.com> <4CFD0633.9060509@freebsd.org> In-Reply-To: <4CFD0633.9060509@freebsd.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_4d1a654b.wI8NqF1oq/fXqFb0P3dTZcQHcnPbwnEUR2uSBDl9zIYjK+nz" Cc: freebsd-stable@freebsd.org Subject: Re: Could MSGBUF_SIZE be made a loader tunable? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Dec 2010 22:50:28 -0000 This is a multi-part message in MIME format. --=_4d1a654b.wI8NqF1oq/fXqFb0P3dTZcQHcnPbwnEUR2uSBDl9zIYjK+nz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Andriy Gapon wrote: > on 06/12/2010 07:20 perryh@pluto.rain.com said the following: > > Would there be some fundamental problem in changing MSGBUF_SIZE > > from a compiled-in constant to a tunable that could be set at the > > loader prompt? > > I didn't see any obvious downside from examining the 8.1-RELEASE > > code ... > I also don't immediately see why that wouldn't work. > Can you try to come up with a patch? I got it working. The first attachment contains the changes to generic and i386-specific files, tested against 8.1-RELEASE. The second attachment contains (untested) corresponding changes to files for other arches. --=_4d1a654b.wI8NqF1oq/fXqFb0P3dTZcQHcnPbwnEUR2uSBDl9zIYjK+nz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="MsgBufSiz.patch-81R-working" --- boot/common/loader.8-81R Sun Jun 13 19:09:06 2010 +++ boot/common/loader.8 Mon Dec 13 21:34:49 2010 @@ -615,6 +615,14 @@ the NBUF parameter will override this limit. Modifies .Dv VM_BCACHE_SIZE_MAX . +.It Va kern.msgbufsize +Sets the size of the kernel message buffer. +The default of 64KB is usually sufficient unless +large amounts of trace data need to be collected +between opportunities to examine the buffer or +dump it to a file. +Modifies kernel option +.Dv MSGBUF_SIZE .It Va machdep.disable_mtrrs Disable the use of i686 MTRRs (x86 only). .It Va net.inet.tcp.tcbhashsize --- boot/forth/loader.conf-81R Sun Jun 13 19:09:06 2010 +++ boot/forth/loader.conf Mon Dec 13 21:50:16 2010 @@ -99,6 +99,7 @@ #kern.maxswzone="" # Set the max swmeta KVA storage #kern.maxtsiz="" # Set the max text size #kern.maxusers="32" # Set size of various static tables +#kern.msgbufsize="" # Set size of kernel message buffer #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events #kern.ngroups="1023" # Set the maximum # of supplemental groups --- kern/subr_param.c-81R Sun Jun 13 19:09:06 2010 +++ kern/subr_param.c Mon Dec 27 00:21:26 2010 @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: src/sys/kern/subr_param.c,v 1.90.2.4.2.1 2010/06/14 02:09:06 kensmith Exp $"); #include "opt_param.h" +#include "opt_msgbuf.h" #include "opt_maxusers.h" #include @@ -45,6 +46,7 @@ #include #include #include +#include #include @@ -89,6 +91,7 @@ int nswbuf; long maxswzone; /* max swmeta KVA storage */ long maxbcache; /* max buffer cache KVA storage */ +long msgbufsize; /* size of kernel message buffer */ long maxpipekva; /* Limit on pipe KVA */ int vm_guest; /* Running as virtual machine guest? */ u_long maxtsiz; /* max text size */ @@ -110,6 +113,8 @@ "Maximum memory for swap metadata"); SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0, "Maximum value of vfs.maxbufspace"); +SYSCTL_LONG(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN, &msgbufsize, 0, + "Size of the kernel message buffer"); SYSCTL_ULONG(_kern, OID_AUTO, maxtsiz, CTLFLAG_RDTUN, &maxtsiz, 0, "Maximum text size"); SYSCTL_ULONG(_kern, OID_AUTO, dfldsiz, CTLFLAG_RDTUN, &dfldsiz, 0, @@ -217,6 +222,10 @@ maxbcache = VM_BCACHE_SIZE_MAX; #endif TUNABLE_LONG_FETCH("kern.maxbcache", &maxbcache); +#ifdef MSGBUF_SIZE + msgbufsize = MSGBUF_SIZE; +#endif + TUNABLE_LONG_FETCH("kern.msgbufsize", &msgbufsize); maxtsiz = MAXTSIZ; TUNABLE_ULONG_FETCH("kern.maxtsiz", &maxtsiz); --- i386/i386/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ i386/i386/machdep.c Mon Dec 27 00:25:40 2010 @@ -50,7 +50,6 @@ #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" @@ -2059,7 +2058,7 @@ physmem = Maxmem; basemem = 0; physmap[0] = init_first << PAGE_SHIFT; - physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); + physmap[1] = ptoa(Maxmem) - round_page(msgbufsize); physmap_idx = 0; goto physmap_done; #endif @@ -2445,7 +2444,7 @@ * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -2454,10 +2453,10 @@ Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); @@ -2666,7 +2665,7 @@ /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* transfer to user mode */ _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); @@ -2921,7 +2920,7 @@ /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; --- i386/i386/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ i386/i386/pmap.c Mon Dec 27 00:23:49 2010 @@ -105,7 +105,6 @@ #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -448,7 +447,7 @@ /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * KPTmap is used by pmap_kextract(). --- sys/msgbuf.h-81R Sun Jun 13 19:09:06 2010 +++ sys/msgbuf.h Mon Dec 27 00:17:41 2010 @@ -54,6 +54,7 @@ #ifdef _KERNEL extern int msgbuftrigger; extern struct msgbuf *msgbufp; +extern long msgbufsize; void msgbufinit(void *ptr, int size); void msgbuf_addchar(struct msgbuf *mbp, int c); --=_4d1a654b.wI8NqF1oq/fXqFb0P3dTZcQHcnPbwnEUR2uSBDl9zIYjK+nz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="MsgBufSiz.patch-81R-otherArch" --- amd64/amd64/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ amd64/amd64/machdep.c Mon Dec 27 22:33:15 2010 @@ -51,7 +51,6 @@ #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" @@ -1499,7 +1498,7 @@ * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -1508,10 +1507,10 @@ Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); } @@ -1708,7 +1707,7 @@ /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); fpuinit(); /* transfer to user mode */ --- arm/at91/at91_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/at91/at91_machdep.c Mon Dec 27 22:33:28 2010 @@ -43,8 +43,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD: src/sys/arm/at91/at91_machdep.c,v 1.6.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $"); @@ -274,7 +272,7 @@ valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -319,7 +317,7 @@ pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); pmap_map_chunk(l1pagetable, msgbufpv.pv_va, msgbufpv.pv_pa, - MSGBUF_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + msgbufsize, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); for (loop = 0; loop < NUM_KERNEL_PTS; ++loop) { pmap_map_chunk(l1pagetable, kernel_pt_table[loop].pv_va, @@ -396,7 +394,7 @@ KERNVIRTADDR + 3 * memsize, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- arm/mv/mv_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/mv/mv_machdep.c Mon Dec 27 22:33:35 2010 @@ -35,7 +35,6 @@ * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -491,7 +490,7 @@ valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -620,7 +619,7 @@ pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); msgbufp = (void *)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); /* --- arm/xscale/i80321/ep80219_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/xscale/i80321/ep80219_machdep.c Mon Dec 27 22:33:43 2010 @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.13.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $"); @@ -247,7 +245,7 @@ valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -397,7 +395,7 @@ pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- arm/xscale/i80321/iq31244_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/xscale/i80321/iq31244_machdep.c Mon Dec 27 22:33:51 2010 @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.34.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $"); @@ -247,7 +245,7 @@ valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -403,7 +401,7 @@ pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- arm/xscale/i8134x/crb_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/xscale/i8134x/crb_machdep.c Mon Dec 27 22:33:58 2010 @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i8134x/crb_machdep.c,v 1.10.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $"); @@ -242,7 +240,7 @@ valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -375,7 +373,7 @@ pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- arm/xscale/ixp425/avila_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/xscale/ixp425/avila_machdep.c Mon Dec 27 22:34:04 2010 @@ -45,8 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" - #include __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.20.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $"); @@ -314,7 +312,7 @@ valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -460,7 +458,7 @@ pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- arm/xscale/pxa/pxa_machdep.c-81R Sun Jun 13 19:09:06 2010 +++ arm/xscale/pxa/pxa_machdep.c Mon Dec 27 22:34:11 2010 @@ -45,7 +45,6 @@ * Created : 17/09/94 */ -#include "opt_msgbuf.h" #include "opt_ddb.h" #include @@ -229,7 +228,7 @@ valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); alloc_pages(minidataclean.pv_pa, 1); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); #ifdef ARM_USE_SMALL_ALLOC freemempos -= PAGE_SIZE; freemem_pt = trunc_page(freemem_pt); @@ -393,7 +392,7 @@ dump_avail[i] = 0; pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); mutex_init(); i = 0; --- i386/xen/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ i386/xen/pmap.c Mon Dec 27 22:14:40 2010 @@ -107,7 +107,6 @@ #include "opt_cpu.h" #include "opt_pmap.h" -#include "opt_msgbuf.h" #include "opt_smp.h" #include "opt_xbox.h" @@ -465,7 +464,7 @@ /* * msgbufp is used to map the system message buffer. */ - SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(MSGBUF_SIZE))) + SYSMAP(struct msgbuf *, unused, msgbufp, atop(round_page(msgbufsize))) /* * ptemap is used for pmap_pte_quick --- ia64/ia64/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ ia64/ia64/machdep.c Mon Dec 27 22:34:21 2010 @@ -31,7 +31,6 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_sched.h" #include @@ -882,8 +881,8 @@ /* * Initialize error message buffer (at end of core). */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); proc_linkup0(&proc0, &thread0); /* --- mips/mips/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ mips/mips/pmap.c Mon Dec 27 22:34:28 2010 @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD: src/sys/mips/mips/pmap.c,v 1.21.2.2.2.1 2010/06/14 02:09:06 kensmith Exp $"); #include "opt_ddb.h" -#include "opt_msgbuf.h" #include #include #include @@ -328,8 +327,8 @@ /* * Steal the message buffer from the beginning of memory. */ - msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufp = (struct msgbuf *)pmap_steal_memory(msgbufsize); + msgbufinit(msgbufp, msgbufsize); /* Steal memory for the dynamic per-cpu area. */ dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); --- pc98/pc98/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ pc98/pc98/machdep.c Mon Dec 27 22:34:37 2010 @@ -49,7 +49,6 @@ #include "opt_isa.h" #include "opt_kstack_pages.h" #include "opt_maxmem.h" -#include "opt_msgbuf.h" #include "opt_npx.h" #include "opt_perfmon.h" @@ -1915,7 +1914,7 @@ * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) >= phys_avail[pa_indx]) { + round_page(msgbufsize) >= phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -1924,10 +1923,10 @@ Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ - for (off = 0; off < round_page(MSGBUF_SIZE); off += PAGE_SIZE) + for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); } @@ -2144,7 +2143,7 @@ /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* make a call gate to reenter kernel with */ gdp = &ldt[LSYS5CALLS_SEL].gd; --- powerpc/aim/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ powerpc/aim/machdep.c Mon Dec 27 22:34:44 2010 @@ -60,7 +60,6 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -530,7 +529,7 @@ pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); #ifdef KDB if (boothowto & RB_KDB) --- powerpc/aim/mmu_oea.c-81R Wed Jun 23 06:47:27 2010 +++ powerpc/aim/mmu_oea.c Mon Dec 27 22:34:51 2010 @@ -935,10 +935,10 @@ /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea_kenter(mmup, va, pa); pa += PAGE_SIZE; --- powerpc/aim/mmu_oea64.c-81R Sun Jun 13 19:09:06 2010 +++ powerpc/aim/mmu_oea64.c Mon Dec 27 22:34:58 2010 @@ -1016,10 +1016,10 @@ /* * Allocate virtual address space for the message buffer. */ - pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); + pa = msgbuf_phys = moea64_bootstrap_alloc(msgbufsize, PAGE_SIZE); msgbufp = (struct msgbuf *)virtual_avail; va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); + virtual_avail += round_page(msgbufsize); while (va < virtual_avail) { moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; --- powerpc/booke/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ powerpc/booke/machdep.c Mon Dec 27 22:35:06 2010 @@ -84,7 +84,6 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -450,7 +449,7 @@ pc->pc_curpcb = thread0.td_pcb; /* Initialise the message buffer. */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* Enable Machine Check interrupt. */ mtmsr(mfmsr() | PSL_ME); --- powerpc/booke/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ powerpc/booke/pmap.c Mon Dec 27 22:35:12 2010 @@ -984,7 +984,7 @@ /* Allocate space for the message buffer. */ msgbufp = (struct msgbuf *)data_end; - data_end += MSGBUF_SIZE; + data_end += msgbufsize; debugf(" msgbufp at 0x%08x end = 0x%08x\n", (uint32_t)msgbufp, data_end); --- sparc64/sparc64/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ sparc64/sparc64/machdep.c Mon Dec 27 22:35:18 2010 @@ -41,7 +41,6 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -574,7 +573,7 @@ * buffer (after setting the trap table). */ dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); /* * Initialize mutexes. --- sparc64/sparc64/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ sparc64/sparc64/pmap.c Mon Dec 27 22:35:23 2010 @@ -66,7 +66,6 @@ */ #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include @@ -396,7 +395,7 @@ /* * Allocate and map the message buffer. */ - pa = pmap_bootstrap_alloc(MSGBUF_SIZE); + pa = pmap_bootstrap_alloc(msgbufsize); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa); /* --- sun4v/sun4v/machdep.c-81R Sun Jun 13 19:09:06 2010 +++ sun4v/sun4v/machdep.c Mon Dec 27 22:35:29 2010 @@ -41,7 +41,6 @@ #include "opt_compat.h" #include "opt_ddb.h" #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include #include @@ -502,7 +501,7 @@ */ BVPRINTF("initialize msgbuf\n"); dpcpu_init(dpcpu0, 0); - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); BVPRINTF("initialize mutexes\n"); mutex_init(); --- sun4v/sun4v/pmap.c-81R Sun Jun 13 19:09:06 2010 +++ sun4v/sun4v/pmap.c Mon Dec 27 22:35:55 2010 @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD: src/sys/sun4v/sun4v/pmap.c,v 1.47.2.2.2.1 2010/06/14 02:09:06 kensmith Exp $"); #include "opt_kstack_pages.h" -#include "opt_msgbuf.h" #include "opt_pmap.h" #include "opt_trap_trace.h" @@ -779,7 +778,7 @@ /* * Allocate and map the message buffer. */ - msgbuf_phys = pmap_bootstrap_alloc(MSGBUF_SIZE); + msgbuf_phys = pmap_bootstrap_alloc(msgbufsize); msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(msgbuf_phys); /* --=_4d1a654b.wI8NqF1oq/fXqFb0P3dTZcQHcnPbwnEUR2uSBDl9zIYjK+nz--