From 1cf2f4550bb4f120f0e07ad81bf93dc72180ca7b Mon Sep 17 00:00:00 2001 From: attilio Date: Fri, 15 Feb 2013 16:05:18 +0000 Subject: On arches with VM_PHYSSEG_DENSE the vm_page_array is larger than the actual number of vm_page_t that will be derived, so v_page_count should be used appropriately. Besides that, add a panic condition in case UMA fails to properly restrict the area in a way to keep all the desired objects. Sponsored by: EMC / Isilon storage division Reported by: alc --- sys/vm/vm_radix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/vm/vm_radix.c') diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c index d7a6e1d..2d28b5c 100644 --- a/sys/vm/vm_radix.c +++ b/sys/vm/vm_radix.c @@ -50,11 +50,11 @@ #include #include #include +#include #include #include #include -#include #include #include @@ -383,7 +383,9 @@ vm_radix_init(void *arg __unused) NULL, #endif NULL, NULL, VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_NOFREE); - nitems = uma_zone_set_max(vm_radix_node_zone, vm_page_array_size); + nitems = uma_zone_set_max(vm_radix_node_zone, cnt.v_page_count); + if (nitems < cnt.v_page_count) + panic("%s: unexpected requested number of items", __func__); uma_prealloc(vm_radix_node_zone, nitems); boot_cache_cnt = VM_RADIX_BOOT_CACHE + 1; } -- cgit v1.1