From 22a97b04de46c48fe8aff8265b5aaa6f69498e4e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 3 Jul 2002 19:16:37 +0000 Subject: [PATCH] o Make the reservation of KVA space for kernel map entries a function of the KVA space's size in addition to the amount of physical memory and reduce it by a factor of two. Under the old formula, our reservation amounted to one kernel map entry per virtual page in the KVA space on a 4GB i386. --- sys/vm/vm_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 437a0ceaff4..6ba42337ee4 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -263,7 +263,8 @@ vmspace_alloc(min, max) void vm_init2(void) { - uma_zone_set_obj(kmapentzone, &kmapentobj, cnt.v_page_count / 4); + uma_zone_set_obj(kmapentzone, &kmapentobj, min(cnt.v_page_count, + (VM_MAX_KERNEL_ADDRESS - KERNBASE) / PAGE_SIZE) / 8); vmspace_zone = uma_zcreate("VMSPACE", sizeof(struct vmspace), NULL, #ifdef INVARIANTS vmspace_zdtor,