Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.

Submitted by:	perryh pluto.rain.com (previous version)
Reviewed by:	jhb
Approved by:	kib (mentor)
Tested by:	universe
This commit is contained in:
Sergey Kandaurov 2011-01-21 10:26:26 +00:00
parent 409daaf37b
commit 4053b05b91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217688
31 changed files with 69 additions and 82 deletions

View File

@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#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"
#include "opt_kdtrace.h"
@ -1504,7 +1503,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
* 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;
@ -1513,7 +1512,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
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. */
msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]);
@ -1714,7 +1713,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
/* now running on new page tables, configured,and u/iom is accessible */
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
fpuinit();
/* transfer to user mode */

View File

@ -43,8 +43,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -302,7 +300,7 @@ initarm(void *arg, void *arg2)
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
@ -347,7 +345,7 @@ initarm(void *arg, void *arg2)
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,
@ -430,7 +428,7 @@ initarm(void *arg, void *arg2)
KERNVIRTADDR + 3 * memsize,
&kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
i = 0;

View File

@ -35,8 +35,6 @@
*
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -251,7 +249,7 @@ initarm(void *arg, void *arg2)
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
@ -293,7 +291,7 @@ initarm(void *arg, void *arg2)
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,
@ -372,7 +370,7 @@ initarm(void *arg, void *arg2)
&kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();

View File

@ -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 "opt_platform.h"
@ -427,7 +426,7 @@ initarm(void *mdp, void *unused __unused)
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
@ -575,7 +574,7 @@ initarm(void *mdp, void *unused __unused)
pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt);
msgbufp = (void *)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
/*

View File

@ -43,7 +43,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include "opt_ddb.h"
#include <sys/cdefs.h>
@ -298,7 +297,7 @@ initarm(void *arg, void *arg2)
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
* We start by mapping the L2 page tables into the L1.
@ -338,7 +337,7 @@ initarm(void *arg, void *arg2)
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) {
@ -429,7 +428,7 @@ initarm(void *arg, void *arg2)
KERNVIRTADDR + 3 * memsize,
&kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
physmem = memsize / PAGE_SIZE;

View File

@ -45,8 +45,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -247,7 +245,7 @@ initarm(void *arg, void *arg2)
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 @@ initarm(void *arg, void *arg2)
pmap_bootstrap(pmap_curmaxkvaddr,
0xd0000000, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
i = 0;

View File

@ -45,8 +45,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -247,7 +245,7 @@ initarm(void *arg, void *arg2)
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 @@ initarm(void *arg, void *arg2)
pmap_bootstrap(pmap_curmaxkvaddr,
0xd0000000, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
i = 0;

View File

@ -45,8 +45,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -242,7 +240,7 @@ initarm(void *arg, void *arg2)
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 @@ initarm(void *arg, void *arg2)
pmap_bootstrap(pmap_curmaxkvaddr,
0xd0000000, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
i = 0;

View File

@ -45,8 +45,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@ -314,7 +312,7 @@ initarm(void *arg, void *arg2)
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 @@ initarm(void *arg, void *arg2)
pmap_bootstrap(pmap_curmaxkvaddr, 0xd0000000, &kernel_l1pt);
msgbufp = (void*)msgbufpv.pv_va;
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
mutex_init();
i = 0;

View File

@ -45,7 +45,6 @@
* Created : 17/09/94
*/
#include "opt_msgbuf.h"
#include "opt_ddb.h"
#include <sys/cdefs.h>
@ -229,7 +228,7 @@ initarm(void *arg, void *arg2)
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 @@ initarm(void *arg, void *arg2)
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;

View File

@ -609,6 +609,14 @@ Note that
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 limit 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.
Overrides kernel option
.Dv MSGBUF_SIZE .
.It Va machdep.disable_mtrrs
Disable the use of i686 MTRRs (x86 only).
.It Va net.inet.tcp.tcbhashsize

View File

@ -99,6 +99,7 @@ module_path="/boot/modules" # Set the module search path
#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

View File

@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
#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"
@ -2115,7 +2114,7 @@ getmemsize(int first)
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;
#else
#ifdef XBOX
@ -2466,7 +2465,7 @@ getmemsize(int first)
* 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;
@ -2475,10 +2474,10 @@ getmemsize(int first)
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);
@ -2689,7 +2688,7 @@ init386(first)
/* 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);
@ -2947,7 +2946,7 @@ init386(first)
/* 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;

View File

@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_pmap.h"
#include "opt_msgbuf.h"
#include "opt_smp.h"
#include "opt_xbox.h"
@ -437,7 +436,7 @@ pmap_bootstrap(vm_paddr_t firstaddr)
/*
* 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().

View File

@ -105,7 +105,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cpu.h"
#include "opt_pmap.h"
#include "opt_msgbuf.h"
#include "opt_smp.h"
#include "opt_xbox.h"
@ -471,7 +470,7 @@ pmap_bootstrap(vm_paddr_t firstaddr)
/*
* 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

View File

@ -31,7 +31,6 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include "opt_sched.h"
#include <sys/param.h>
@ -888,8 +887,8 @@ ia64_init(void)
/*
* 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);
/*

View File

@ -38,6 +38,7 @@
__FBSDID("$FreeBSD$");
#include "opt_param.h"
#include "opt_msgbuf.h"
#include "opt_maxusers.h"
#include <sys/limits.h>
@ -45,6 +46,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/msgbuf.h>
#include <vm/vm_param.h>
@ -83,6 +85,7 @@ int maxproc; /* maximum # of processes */
int maxprocperuid; /* max # of procs per user */
int maxfiles; /* sys. wide open files limit */
int maxfilesperproc; /* per-proc open files limit */
int msgbufsize; /* size of kernel message buffer */
int ncallout; /* maximum # of timer events */
int nbuf;
int ngroups_max; /* max # groups per process */
@ -106,6 +109,8 @@ SYSCTL_INT(_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN, &nbuf, 0,
"Number of buffers in the buffer cache");
SYSCTL_INT(_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN, &nswbuf, 0,
"Number of swap buffers");
SYSCTL_INT(_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN, &msgbufsize, 0,
"Size of the kernel message buffer");
SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
"Maximum memory for swap metadata");
SYSCTL_LONG(_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN, &maxbcache, 0,
@ -218,6 +223,8 @@ init_param1(void)
maxbcache = VM_BCACHE_SIZE_MAX;
#endif
TUNABLE_LONG_FETCH("kern.maxbcache", &maxbcache);
msgbufsize = MSGBUF_SIZE;
TUNABLE_INT_FETCH("kern.msgbufsize", &msgbufsize);
maxtsiz = MAXTSIZ;
TUNABLE_ULONG_FETCH("kern.maxtsiz", &maxtsiz);

View File

@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include "opt_cputype.h"
#include "opt_ddb.h"
#include "opt_md.h"
#include "opt_msgbuf.h"
#include <sys/param.h>
#include <sys/proc.h>

View File

@ -68,7 +68,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_msgbuf.h"
#include "opt_ddb.h"
#include <sys/param.h>
@ -546,8 +545,8 @@ pmap_bootstrap(void)
/*
* 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 thread0 kstack.

View File

@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
#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"
@ -2066,7 +2065,7 @@ getmemsize(int first)
* 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;
@ -2075,10 +2074,10 @@ getmemsize(int first)
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);
}
@ -2293,7 +2292,7 @@ init386(first)
/* 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;

View File

@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include <sys/param.h>
#include <sys/proc.h>
@ -555,7 +554,7 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
pc->pc_curpcb = thread0.td_pcb;
/* Initialise the message buffer. */
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
#ifdef KDB
if (boothowto & RB_KDB)

View File

@ -921,10 +921,10 @@ moea_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend)
/*
* 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;

View File

@ -950,10 +950,10 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend
/*
* 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;

View File

@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include "opt_platform.h"
#include <sys/cdefs.h>
@ -420,7 +419,7 @@ e500_init(u_int32_t startkernel, u_int32_t endkernel, void *mdp)
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);

View File

@ -979,7 +979,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend)
/* 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);

View File

@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include <sys/param.h>
#include <sys/malloc.h>
@ -581,7 +580,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
* buffer (after setting the trap table).
*/
dpcpu_init(dpcpu0, 0);
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
/*
* Initialize mutexes.

View File

@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
*/
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include "opt_pmap.h"
#include <sys/param.h>
@ -439,7 +438,7 @@ pmap_bootstrap(u_int cpu_impl)
/*
* Allocate and map the message buffer.
*/
pa = pmap_bootstrap_alloc(MSGBUF_SIZE, colors);
pa = pmap_bootstrap_alloc(msgbufsize, colors);
msgbufp = (struct msgbuf *)TLB_PHYS_TO_DIRECT(pa);
/*

View File

@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include "opt_compat.h"
#include "opt_ddb.h"
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include <sys/param.h>
#include <sys/malloc.h>
@ -504,7 +503,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
*/
BVPRINTF("initialize msgbuf\n");
dpcpu_init(dpcpu0, 0);
msgbufinit(msgbufp, MSGBUF_SIZE);
msgbufinit(msgbufp, msgbufsize);
BVPRINTF("initialize mutexes\n");
mutex_init();

View File

@ -29,7 +29,6 @@
__FBSDID("$FreeBSD$");
#include "opt_kstack_pages.h"
#include "opt_msgbuf.h"
#include "opt_pmap.h"
#include "opt_trap_trace.h"
@ -782,7 +781,7 @@ pmap_bootstrap(vm_offset_t ekva)
/*
* 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);
/*

View File

@ -52,6 +52,7 @@ struct msgbuf {
#define MSGBUF_SEQSUB(mbp, seq1, seq2) (MSGBUF_SEQNORM((mbp), (seq1) - (seq2)))
#ifdef _KERNEL
extern int msgbufsize;
extern int msgbuftrigger;
extern struct msgbuf *msgbufp;
extern struct mtx msgbuf_lock;

View File

@ -100,7 +100,6 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_msgbuf.h"
#include "opt_vm.h"
#include <sys/param.h>
@ -375,7 +374,7 @@ vm_page_startup(vm_offset_t vaddr)
* through the direct map, they are not automatically included.
*/
pa = DMAP_TO_PHYS((vm_offset_t)msgbufp->msg_ptr);
last_pa = pa + round_page(MSGBUF_SIZE);
last_pa = pa + round_page(msgbufsize);
while (pa < last_pa) {
dump_add_page(pa);
pa += PAGE_SIZE;