slub: Simplify control flow in __slab_alloc()
Simplify control flow a bit avoiding nesting. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Родитель
7ced371971
Коммит
f469743673
14
mm/slub.c
14
mm/slub.c
|
@ -2272,17 +2272,15 @@ new_slab:
|
||||||
/* 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)))
|
||||||
|
|
Загрузка…
Ссылка в новой задаче