Commit f4697436 authored by Christoph Lameter's avatar Christoph Lameter Committed by Pekka Enberg

slub: Simplify control flow in __slab_alloc()

Simplify control flow a bit avoiding nesting.
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 7ced3719
...@@ -2272,17 +2272,15 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2272,17 +2272,15 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
/* Then do expensive stuff like retrieving pages from the partial lists */ /* Then do expensive stuff like retrieving pages from the partial lists */
freelist = get_partial(s, gfpflags, node, c); freelist = get_partial(s, gfpflags, node, c);
if (unlikely(!freelist)) { if (!freelist)
freelist = new_slab_objects(s, gfpflags, node, &c); freelist = new_slab_objects(s, gfpflags, node, &c);
if (unlikely(!freelist)) { if (unlikely(!freelist)) {
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
slab_out_of_memory(s, gfpflags, node); slab_out_of_memory(s, gfpflags, node);
local_irq_restore(flags); local_irq_restore(flags);
return NULL; return NULL;
}
} }
if (likely(!kmem_cache_debug(s))) if (likely(!kmem_cache_debug(s)))
......
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