Commit 441c7e0a authored by Pekka Enberg's avatar Pekka Enberg
Browse files

bootmem: use slab if bootmem is no longer available

As a preparation for initializing the slab allocator early, make sure the
bootmem allocator does not crash and burn if someone calls it after slab is up;
otherwise we'd need a flag day for switching to early slab.
Acked-by: default avatarJohannes Weiner <>
Acked-by: default avatarLinus Torvalds <>
Cc: Christoph Lameter <>
Cc: Ingo Molnar <>
Cc: Matt Mackall <>
Cc: Nick Piggin <>
Cc: Yinghai Lu <>
Signed-off-by: default avatarPekka Enberg <>
parent 991ec02c
......@@ -532,6 +532,9 @@ static void * __init alloc_arch_preferred_bootmem(bootmem_data_t *bdata,
unsigned long size, unsigned long align,
unsigned long goal, unsigned long limit)
if (WARN_ON_ONCE(slab_is_available()))
return kzalloc(size, GFP_NOWAIT);
bootmem_data_t *p_bdata;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment