diff options
author | alc <alc@FreeBSD.org> | 2013-11-08 16:25:00 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2013-11-08 16:25:00 +0000 |
commit | 6c60c884526247d8f1789333d8df5de7adaddcbc (patch) | |
tree | 10be1b225c61aa3fef5a16664784e1bc60913d34 /sys/i386 | |
parent | a1626fee639681689e4cad1607256138d15f47a1 (diff) | |
download | FreeBSD-src-6c60c884526247d8f1789333d8df5de7adaddcbc.zip FreeBSD-src-6c60c884526247d8f1789333d8df5de7adaddcbc.tar.gz |
As of r257209, all architectures have defined VM_KMEM_SIZE_SCALE. In other
words, every architecture is now auto-sizing the kmem arena. This revision
changes kmeminit() so that the definition of VM_KMEM_SIZE_SCALE becomes
mandatory and the definition of VM_KMEM_SIZE becomes optional.
Replace or eliminate all existing definitions of VM_KMEM_SIZE. With
auto-sizing enabled, VM_KMEM_SIZE effectively became an alternate spelling
for VM_KMEM_SIZE_MIN on most architectures. Use VM_KMEM_SIZE_MIN for
clarity.
Change kmeminit() so that the effect of defining VM_KMEM_SIZE is similar to
that of setting the tunable vm.kmem_size. Whereas the macros
VM_KMEM_SIZE_{MAX,MIN,SCALE} have had the same effect as the tunables
vm.kmem_size_{max,min,scale}, the effects of VM_KMEM_SIZE and vm.kmem_size
have been distinct. In particular, whereas VM_KMEM_SIZE was overridden by
VM_KMEM_SIZE_{MAX,MIN,SCALE} and vm.kmem_size_{max,min,scale}, vm.kmem_size
was not. Remedy this inconsistency. Now, VM_KMEM_SIZE can be used to set
the size of the kmem arena at compile-time without that value being
overridden by auto-sizing.
Update the nearby comments to reflect the kmem submap being replaced by the
kmem arena. Stop duplicating the auto-sizing formula in every machine-
dependent vmparam.h and place it in kmeminit() where auto-sizing takes
place.
Reviewed by: kib (an earlier version)
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/include/vmparam.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/i386/include/vmparam.h b/sys/i386/include/vmparam.h index 19cdd8e..c086d76 100644 --- a/sys/i386/include/vmparam.h +++ b/sys/i386/include/vmparam.h @@ -164,24 +164,23 @@ #define VM_MAX_ADDRESS VADDR(PTDPTDI, PTDPTDI) #define VM_MIN_ADDRESS ((vm_offset_t)0) -/* virtual sizes (bytes) for various kernel submaps */ -#ifndef VM_KMEM_SIZE -#define VM_KMEM_SIZE (12 * 1024 * 1024) -#endif - /* - * How many physical pages per KVA page allocated. - * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), - * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) - * is the total KVA space allocated for kmem_map. + * How many physical pages per kmem arena virtual page. */ #ifndef VM_KMEM_SIZE_SCALE #define VM_KMEM_SIZE_SCALE (3) #endif /* - * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space - * rounded to the nearest multiple of the superpage size. + * Optional floor (in bytes) on the size of the kmem arena. + */ +#ifndef VM_KMEM_SIZE_MIN +#define VM_KMEM_SIZE_MIN (12 * 1024 * 1024) +#endif + +/* + * Optional ceiling (in bytes) on the size of the kmem arena: 40% of the + * kernel map rounded to the nearest multiple of the superpage size. */ #ifndef VM_KMEM_SIZE_MAX #define VM_KMEM_SIZE_MAX (((((VM_MAX_KERNEL_ADDRESS - \ |