diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index 503e536..fe4faf9 100644 --- a/sys/vm/vm_zone.c +++ b/sys/vm/vm_zone.c @@ -31,7 +31,9 @@ #include #include #include -#include /* XXX */ + +#include +#include static MALLOC_DEFINE(M_ZONE, "ZONE", "Zone header"); @@ -39,8 +41,6 @@ static MALLOC_DEFINE(M_ZONE, "ZONE", "Zone header"); #define ZONE_ERROR_NOTFREE 1 #define ZONE_ERROR_ALREADYFREE 2 -#define ZONE_ROUNDING 32 - #define ZENTRY_FREE 0x12342378 static void *zget(vm_zone_t z); @@ -159,7 +159,7 @@ zinitna(vm_zone_t z, vm_object_t obj, char *name, int size, panic("zinitna: can't create destroyable zone"); if ((z->zflags & ZONE_BOOT) == 0) { - z->zsize = (size + ZONE_ROUNDING - 1) & ~(ZONE_ROUNDING - 1); + z->zsize = size; spin_init(&z->zlock); z->zfreecnt = 0; z->ztotal = 0; @@ -372,6 +372,7 @@ zget(vm_zone_t z) * Interrupt zones do not mess with the kernel_map, they * simply populate an existing mapping. */ + get_mplock(); nbytes = z->zpagecount * PAGE_SIZE; nbytes -= nbytes % z->zsize; item = (char *) z->zkva + nbytes; @@ -401,6 +402,7 @@ zget(vm_zone_t z) vmstats.v_wire_count++; } nitems = ((z->zpagecount * PAGE_SIZE) - nbytes) / z->zsize; + rel_mplock(); } else if (z->zflags & ZONE_SPECIAL) { /* * The special zone is the one used for vm_map_entry_t's.