diff options
-rw-r--r-- | sys/vm/uma_core.c | 15 | ||||
-rw-r--r-- | sys/vm/uma_int.h | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 7fb120afc711..f96954700612 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -134,6 +134,8 @@ static struct mtx uma_boot_pages_mtx; /* Is the VM done starting up? */ static int booted = 0; +#define UMA_STARTUP 1 +#define UMA_STARTUP2 2 /* Maximum number of allowed items-per-slab if the slab header is OFFPAGE */ static u_int uma_max_ipers; @@ -959,7 +961,7 @@ startup_alloc(uma_zone_t zone, int bytes, u_int8_t *pflag, int wait) return (tmps->us_data); } mtx_unlock(&uma_boot_pages_mtx); - if (booted == 0) + if (booted < UMA_STARTUP2) panic("UMA: Increase vm.boot_pages"); /* * Now that we've booted reset these users to their real allocator. @@ -1317,9 +1319,10 @@ keg_ctor(void *mem, int size, void *udata, int flags) keg->uk_allocf = uma_small_alloc; keg->uk_freef = uma_small_free; #endif - if (booted == 0) + if (booted < UMA_STARTUP) keg->uk_allocf = startup_alloc; - } else if (booted == 0 && (keg->uk_flags & UMA_ZFLAG_INTERNAL)) + } else if (booted < UMA_STARTUP2 && + (keg->uk_flags & UMA_ZFLAG_INTERNAL)) keg->uk_allocf = startup_alloc; /* @@ -1752,9 +1755,7 @@ uma_startup(void *bootmem, int boot_pages) bucket_init(); -#if defined(UMA_MD_SMALL_ALLOC) && !defined(UMA_MD_SMALL_ALLOC_NEEDS_VM) - booted = 1; -#endif + booted = UMA_STARTUP; #ifdef UMA_DEBUG printf("UMA startup complete.\n"); @@ -1765,7 +1766,7 @@ uma_startup(void *bootmem, int boot_pages) void uma_startup2(void) { - booted = 1; + booted = UMA_STARTUP2; bucket_enable(); #ifdef UMA_DEBUG printf("UMA startup2 complete.\n"); diff --git a/sys/vm/uma_int.h b/sys/vm/uma_int.h index ae3e2ff33c68..b2b5bac07fbc 100644 --- a/sys/vm/uma_int.h +++ b/sys/vm/uma_int.h @@ -118,7 +118,7 @@ #define UMA_SLAB_MASK (PAGE_SIZE - 1) /* Mask to get back to the page */ #define UMA_SLAB_SHIFT PAGE_SHIFT /* Number of bits PAGE_MASK */ -#define UMA_BOOT_PAGES 48 /* Pages allocated for startup */ +#define UMA_BOOT_PAGES 64 /* Pages allocated for startup */ /* Max waste before going to off page slab management */ #define UMA_MAX_WASTE (UMA_SLAB_SIZE / 10) |