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
This commit is contained in:
parent
ac0c0d2f8c
commit
86ee7095b9
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user