From 8b1373b33e38c4dc3c45820ed545b32ab925a42f Mon Sep 17 00:00:00 2001 From: des Date: Tue, 27 Jan 2004 15:59:38 +0000 Subject: [PATCH] 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. --- sys/boot/common/help.common | 2 +- sys/boot/common/loader.8 | 10 +++++----- sys/boot/forth/loader.conf | 2 +- sys/kern/kern_malloc.c | 8 +++++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/sys/boot/common/help.common b/sys/boot/common/help.common index a6fd748f428..8b68157c218 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= VM_KMEM_SIZE + set vm.kmem_size= 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 2712da12f18..ef9456b70c6 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 18c34d0c035..48791d73449 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 62fc909c732..cbcbe9e2514 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. -- 2.45.2