summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index a6447a5..ad0d0e9 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -475,8 +475,8 @@ kmeminit(dummy)
if ((vm_kmem_size / 2) > (cnt.v_page_count * PAGE_SIZE))
vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE;
- npg = (nmbufs * MSIZE + nmbclusters * MCLBYTES + vm_kmem_size)
- / PAGE_SIZE;
+ npg = (nmbufs * MSIZE + nmbclusters * MCLBYTES + nmbcnt *
+ sizeof(union mext_refcnt) + vm_kmem_size) / PAGE_SIZE;
kmemusage = (struct kmemusage *) kmem_alloc(kernel_map,
(vm_size_t)(npg * sizeof(struct kmemusage)));
OpenPOWER on IntegriCloud