Rename the kern.vm.kmem.size tunable to the more logical vm.kmem_size. To

assure backward compatibility (conditional on !BURN_BRIDGES), look it up
by its old name first, and log a warning (but accept the setting) if it
was found.  If both the old and new name are defined, the new name takes
precedence.

Also export vm.kmem_size as a read-only sysctl variable; I find it hard to
tune a parameter when I don't know its default value, especially when that
default value is computed at boot time.
This commit is contained in:
Dag-Erling Smørgrav 2004-01-27 15:59:38 +00:00
parent 823261a3e1
commit 84344f9fbf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125091
4 changed files with 14 additions and 8 deletions

View File

@ -244,7 +244,7 @@
Set the number of sendfile buffers to be allocated. This
overrides the value determined when the kernel was compiled.
set kern.vm.kmem.size=<value> VM_KMEM_SIZE
set vm.kmem_size=<value> VM_KMEM_SIZE
Sets the size of kernel memory (bytes). This overrides
the value determined when the kernel was compiled.

View File

@ -451,11 +451,6 @@ Set the number of
buffers to be allocated.
Overrides
.Dv NSFBUFS .
.It Va kern.vm.kmem.size
Sets the size of kernel memory (bytes).
This overrides the value determined when the kernel was compiled.
Modifies
.Va VM_KMEM_SIZE .
.It Va kern.maxswzone
Limits the amount of KVM to be used to hold swap
meta information, which directly governs the
@ -499,6 +494,11 @@ Overrides the compile-time set value of
or the preset default of 512.
Must be a power of 2.
.El
.It Va vm.kmem_size
Sets the size of kernel memory (bytes).
This overrides the value determined when the kernel was compiled.
Modifies
.Va VM_KMEM_SIZE .
.Ss BUILTIN PARSER
When a builtin command is executed, the rest of the line is taken
by it as arguments, and it is processed by a special parser which

View File

@ -96,10 +96,10 @@ module_path="/boot/kernel;/boot/modules" # Set the module search path
#kern.ipc.nmbclusters="" # Set the number of mbuf clusters
#kern.ipc.nmbufs="" # Set the maximum number of mbufs
#kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs
#kern.vm.kmem.size="" # Sets the size of kernel memory (bytes)
#net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE
#vfs.root.mountfrom="" # Specify root partition in a way the
# kernel understands
#vm.kmem_size="" # Sets the size of kernel memory (bytes)
#debug.ktr.cpumask="0xf" # Bitmask of CPUs to enable KTR on
#debug.ktr.mask="0x1200" # Bitmask of KTR events to enable
#debug.ktr.verbose="1" # Enable console dump of KTR events

View File

@ -133,6 +133,8 @@ struct {
};
u_int vm_kmem_size;
SYSCTL_UINT(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0,
"Size of kernel memory");
/*
* The malloc_mtx protects the kmemstatistics linked list.
@ -444,7 +446,11 @@ kmeminit(dummy)
#endif
/* Allow final override from the kernel environment */
TUNABLE_INT_FETCH("kern.vm.kmem.size", &vm_kmem_size);
#ifndef BURN_BRIDGES
if (TUNABLE_INT_FETCH("kern.vm.kmem.size", &vm_kmem_size) != 0)
printf("kern.vm.kmem.size is now called vm.kmem_size!\n");
#endif
TUNABLE_INT_FETCH("vm.kmem_size", &vm_kmem_size);
/*
* Limit kmem virtual size to twice the physical memory.