slub: Remove useless statements in __slab_alloc
Two statements in __slab_alloc() do not have any effect. 1. c->page is already set to NULL by deactivate_slab() called right before. 2. gfpflags are masked in new_slab() before being passed to the page allocator. There is no need to mask gfpflags in __slab_alloc in particular since most frequent processing in __slab_alloc does not require the use of a gfpmask. Cc: torvalds@linux-foundation.org Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Родитель
69cb8e6b7c
Коммит
7db0d70540
|
@ -2064,9 +2064,6 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
|
||||||
c = this_cpu_ptr(s->cpu_slab);
|
c = this_cpu_ptr(s->cpu_slab);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We handle __GFP_ZERO in the caller */
|
|
||||||
gfpflags &= ~__GFP_ZERO;
|
|
||||||
|
|
||||||
page = c->page;
|
page = c->page;
|
||||||
if (!page)
|
if (!page)
|
||||||
goto new_slab;
|
goto new_slab;
|
||||||
|
@ -2163,7 +2160,6 @@ debug:
|
||||||
|
|
||||||
c->freelist = get_freepointer(s, object);
|
c->freelist = get_freepointer(s, object);
|
||||||
deactivate_slab(s, c);
|
deactivate_slab(s, c);
|
||||||
c->page = NULL;
|
|
||||||
c->node = NUMA_NO_NODE;
|
c->node = NUMA_NO_NODE;
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
return object;
|
return object;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче