Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c +++ sys/vm/uma_core.c @@ -1568,7 +1568,14 @@ "new wasted space = %d\n", keg->uk_name, keg, wastedspace, slabsize / UMA_MAX_WASTE, keg->uk_ipers, slabsize - keg->uk_ipers * keg->uk_rsize); - keg->uk_flags |= UMA_ZONE_OFFPAGE; + /* + * If we had access to memory to embed a slab header we + * also have a page structure to use vtoslab() instead of + * hash to find slabs. If the zone was explicitly created + * OFFPAGE we can't necessarily touch the memory. + */ + if ((keg->uk_flags & UMA_ZONE_OFFPAGE) == 0) + keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; } if ((keg->uk_flags & UMA_ZONE_OFFPAGE) && @@ -1608,7 +1615,7 @@ * slab header. */ if ((keg->uk_flags & UMA_ZFLAG_INTERNAL) == 0) - keg->uk_flags |= UMA_ZONE_OFFPAGE; + keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; else keg->uk_ppera++; }