Index: head/sys/vm/uma_core.c =================================================================== --- head/sys/vm/uma_core.c +++ head/sys/vm/uma_core.c @@ -585,7 +585,7 @@ uma_keg_t keg; u_int slabs; - if ((zone->uz_flags & UMA_ZFLAG_CACHE) != 0) + if ((zone->uz_flags & UMA_ZONE_HASH) == 0) goto update_wss; keg = zone->uz_keg; @@ -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++; }