summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-11-17 00:40:48 +0000
committerjlemon <jlemon@FreeBSD.org>2001-11-17 00:40:48 +0000
commit86ee7095b92eeb2d5ad9405bc3e1385692807a80 (patch)
tree17dedf9097469de1b55ba3cd1a6716df7cae3838 /sys/vm
parentac0c0d2f8c602fc1be33408852e2b62c9ca96bd8 (diff)
downloadFreeBSD-src-86ee7095b92eeb2d5ad9405bc3e1385692807a80.zip
FreeBSD-src-86ee7095b92eeb2d5ad9405bc3e1385692807a80.tar.gz
When laying out objects in a ZONE_INTERRUPT zone, allow them to cross
a page boundary, since we've already allocated all our contiguous kva space up front. This eliminates some memory wastage, and allows us to actually reach the # of objects were specified in the zinit() call. Reviewed by: peter, dillon
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_zone.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c
index 78c6f71..a1b1d3c 100644
--- a/sys/vm/vm_zone.c
+++ b/sys/vm/vm_zone.c
@@ -373,7 +373,9 @@ _zget(vm_zone_t z)
KASSERT(z != NULL, ("invalid zone"));
if (z->zflags & ZONE_INTERRUPT) {
- item = (char *) z->zkva + z->zpagecount * PAGE_SIZE;
+ nbytes = z->zpagecount * PAGE_SIZE;
+ nbytes -= nbytes % z->zsize;
+ item = (char *) z->zkva + nbytes;
for (i = 0; ((i < z->zalloc) && (z->zpagecount < z->zpagemax));
i++) {
vm_offset_t zkva;
@@ -390,7 +392,7 @@ _zget(vm_zone_t z)
atomic_add_int(&zone_kmem_pages, 1);
cnt.v_wire_count++;
}
- nitems = (i * PAGE_SIZE) / z->zsize;
+ nitems = ((z->zpagecount * PAGE_SIZE) - nbytes) / z->zsize;
} else {
/* Please check zdestroy() when changing this! */
nbytes = z->zalloc * PAGE_SIZE;
OpenPOWER on IntegriCloud