summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-01-27 15:59:38 +0000
committerdes <des@FreeBSD.org>2004-01-27 15:59:38 +0000
commit8b1373b33e38c4dc3c45820ed545b32ab925a42f (patch)
tree9e58d7f936db3e7c9b66ae5062591d65e619d74c
parent58a1b901a48dccc815bfbd085b4cc8daa118b51a (diff)
downloadFreeBSD-src-8b1373b33e38c4dc3c45820ed545b32ab925a42f.zip
FreeBSD-src-8b1373b33e38c4dc3c45820ed545b32ab925a42f.tar.gz
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.
-rw-r--r--sys/boot/common/help.common2
-rw-r--r--sys/boot/common/loader.810
-rw-r--r--sys/boot/forth/loader.conf2
-rw-r--r--sys/kern/kern_malloc.c8
4 files changed, 14 insertions, 8 deletions
diff --git a/sys/boot/common/help.common b/sys/boot/common/help.common
index a6fd748..8b68157 100644
--- a/sys/boot/common/help.common
+++ b/sys/boot/common/help.common
@@ -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.
diff --git a/sys/boot/common/loader.8 b/sys/boot/common/loader.8
index 2712da1..ef9456b 100644
--- a/sys/boot/common/loader.8
+++ b/sys/boot/common/loader.8
@@ -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
diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf
index 18c34d0..48791d7 100644
--- a/sys/boot/forth/loader.conf
+++ b/sys/boot/forth/loader.conf
@@ -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
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 62fc909..cbcbe9e 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -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.
OpenPOWER on IntegriCloud