From: Christoph Lameter Date: Wed, 9 May 2012 15:09:54 +0000 (-0500) Subject: slub: Simplify control flow in __slab_alloc() X-Git-Tag: upstream/snapshot3+hdmi~6922^2~23^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f469743673ceda5181970eb6b8090ba728c956fb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git slub: Simplify control flow in __slab_alloc() Simplify control flow a bit avoiding nesting. Signed-off-by: Christoph Lameter Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 9892775..5aacd43 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2272,17 +2272,15 @@ new_slab: /* Then do expensive stuff like retrieving pages from the partial lists */ freelist = get_partial(s, gfpflags, node, c); - if (unlikely(!freelist)) { - + if (!freelist) freelist = new_slab_objects(s, gfpflags, node, &c); - if (unlikely(!freelist)) { - if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) - slab_out_of_memory(s, gfpflags, node); + if (unlikely(!freelist)) { + if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) + slab_out_of_memory(s, gfpflags, node); - local_irq_restore(flags); - return NULL; - } + local_irq_restore(flags); + return NULL; } if (likely(!kmem_cache_debug(s)))