summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_radix.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-15 16:05:18 +0000
committerattilio <attilio@FreeBSD.org>2013-02-15 16:05:18 +0000
commit1cf2f4550bb4f120f0e07ad81bf93dc72180ca7b (patch)
tree6df4c9fd3db2a98eedbf15aa81d1f91133543994 /sys/vm/vm_radix.c
parent757b9508040964f39cbef2b3f862833321538073 (diff)
downloadFreeBSD-src-1cf2f4550bb4f120f0e07ad81bf93dc72180ca7b.zip
FreeBSD-src-1cf2f4550bb4f120f0e07ad81bf93dc72180ca7b.tar.gz
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
Diffstat (limited to 'sys/vm/vm_radix.c')
-rw-r--r--sys/vm/vm_radix.c6
1 files changed, 4 insertions, 2 deletions
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 <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/vmmeter.h>
#include <vm/uma.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
-#include <vm/vm_extern.h>
#include <vm/vm_page.h>
#include <vm/vm_radix.h>
@@ -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;
}
OpenPOWER on IntegriCloud