Date: Sat, 2 May 2009 16:34:55 -0700 From: Artem Belevich <fbsdlist@src.cx> To: Freddie Cash <fjwcash@gmail.com> Cc: FreeBSD Stable <freebsd-stable@freebsd.org> Subject: Re: current zfs tuning in RELENG_7 (AMD64) suggestions ? Message-ID: <ed91d4a80905021634k46f51785v7ae69193b240d653@mail.gmail.com> In-Reply-To: <b269bc570905021437h673f97f8l479bd9b20cb2c0cc@mail.gmail.com> References: <E1LzzjJ-0002eV-5A@dilbert.ticketswitch.com> <32A0BDD9-ACF8-43F4-8D2C-0FC151F1D7CB@cryptomonkeys.org> <b269bc570905011628x61105871t5fb0cdbad310ac1c@mail.gmail.com> <ca3526250905021211h4f9139a4xe1b0e429b465c402@mail.gmail.com> <b269bc570905021437h673f97f8l479bd9b20cb2c0cc@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
>> This information is outdated. The current max in RELENG_7 for amd64 is
>> ~3.75GB.
Technically, RELENG_7 should allow kmem_size of up to 6G, but the
sysctl variables used for tuning are 32-bit and *that* limits
kmem_size to ~4G.
It's been fixed in -current and can easily be fixed in RELENG_7 (if
it's not fixedyet).
As far as I can tell, all necessary code to support large kmem_size is
already in RELENG_7. It's easy enough to allow even larger kmem_size.
See attached diff that I'm using. With that diff you can set
vm.kmem_size to ~16G.
--Artem
[-- Attachment #2 --]
diff -r bbee47b28f7f amd64/include/vmparam.h
--- a/amd64/include/vmparam.h Sat Jan 31 21:03:53 2009 -0800
+++ b/amd64/include/vmparam.h Sat May 02 16:25:42 2009 -0700
@@ -149,7 +149,7 @@
*/
#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-1, NPDEPG-1, NPTEPG-1)
-#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-6, 0, 0)
+#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4I, NPDPEPG-16, 0, 0)
#define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0)
#define DMAP_MAX_ADDRESS KVADDR(DMPML4I+1, 0, 0, 0)
diff -r bbee47b28f7f kern/kern_malloc.c
--- a/kern/kern_malloc.c Sat Jan 31 21:03:53 2009 -0800
+++ b/kern/kern_malloc.c Sat May 02 16:25:42 2009 -0700
@@ -181,16 +181,16 @@
*/
static uma_zone_t mt_zone;
-u_int vm_kmem_size;
-SYSCTL_UINT(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0,
+u_long vm_kmem_size;
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size, CTLFLAG_RD, &vm_kmem_size, 0,
"Size of kernel memory");
-u_int vm_kmem_size_min;
-SYSCTL_UINT(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0,
+u_long vm_kmem_size_min;
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_min, CTLFLAG_RD, &vm_kmem_size_min, 0,
"Minimum size of kernel memory");
-u_int vm_kmem_size_max;
-SYSCTL_UINT(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0,
+u_long vm_kmem_size_max;
+SYSCTL_ULONG(_vm, OID_AUTO, kmem_size_max, CTLFLAG_RD, &vm_kmem_size_max, 0,
"Maximum size of kernel memory");
u_int vm_kmem_size_scale;
@@ -589,7 +589,7 @@
#if defined(VM_KMEM_SIZE_MIN)
vm_kmem_size_min = VM_KMEM_SIZE_MIN;
#endif
- TUNABLE_INT_FETCH("vm.kmem_size_min", &vm_kmem_size_min);
+ TUNABLE_ULONG_FETCH("vm.kmem_size_min", &vm_kmem_size_min);
if (vm_kmem_size_min > 0 && vm_kmem_size < vm_kmem_size_min) {
vm_kmem_size = vm_kmem_size_min;
}
@@ -597,17 +597,19 @@
#if defined(VM_KMEM_SIZE_MAX)
vm_kmem_size_max = VM_KMEM_SIZE_MAX;
#endif
- TUNABLE_INT_FETCH("vm.kmem_size_max", &vm_kmem_size_max);
+ TUNABLE_ULONG_FETCH("vm.kmem_size_max", &vm_kmem_size_max);
if (vm_kmem_size_max > 0 && vm_kmem_size >= vm_kmem_size_max)
vm_kmem_size = vm_kmem_size_max;
/* Allow final override from the kernel environment */
#ifndef BURN_BRIDGES
- if (TUNABLE_INT_FETCH("kern.vm.kmem.size", &vm_kmem_size) != 0)
+ if (TUNABLE_ULONG_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);
+ TUNABLE_ULONG_FETCH("vm.kmem_size", &vm_kmem_size);
+#if 0 /* don't enforce kmem size limit */
+
/*
* Limit kmem virtual size to twice the physical memory.
* This allows for kmem map sparseness, but limits the size
@@ -616,7 +618,8 @@
*/
if (((vm_kmem_size / 2) / PAGE_SIZE) > cnt.v_page_count)
vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE;
-
+#endif
+
/*
* Tune settings based on the kmem map's size at this time.
*/
diff -r bbee47b28f7f vm/vm_kern.h
--- a/vm/vm_kern.h Sat Jan 31 21:03:53 2009 -0800
+++ b/vm/vm_kern.h Sat May 02 16:25:42 2009 -0700
@@ -69,6 +69,6 @@
extern vm_map_t kmem_map;
extern vm_map_t exec_map;
extern vm_map_t pipe_map;
-extern u_int vm_kmem_size;
+extern u_long vm_kmem_size;
#endif /* _VM_VM_KERN_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ed91d4a80905021634k46f51785v7ae69193b240d653>
