Commit 442b06bc authored by Christoph Lameter's avatar Christoph Lameter Committed by Pekka Enberg

slub: Remove node check in slab_free

We can set the page pointing in the percpu structure to
NULL to have the same effect as setting c->node to NUMA_NO_NODE.

Gets rid of one check in slab_free() that was only used for
forcing the slab_free to the slowpath for debugging.

We still need to set c->node to NUMA_NO_NODE to force the
slab_alloc() fastpath to the slowpath in case of debugging.
Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent bd07d87f
...@@ -1881,6 +1881,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -1881,6 +1881,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
page->inuse++; page->inuse++;
page->freelist = get_freepointer(s, object); page->freelist = get_freepointer(s, object);
deactivate_slab(s, c);
c->page = NULL;
c->node = NUMA_NO_NODE; c->node = NUMA_NO_NODE;
goto unlock_out; goto unlock_out;
} }
...@@ -2112,7 +2114,7 @@ static __always_inline void slab_free(struct kmem_cache *s, ...@@ -2112,7 +2114,7 @@ static __always_inline void slab_free(struct kmem_cache *s,
tid = c->tid; tid = c->tid;
barrier(); barrier();
if (likely(page == c->page && c->node != NUMA_NO_NODE)) { if (likely(page == c->page)) {
set_freepointer(s, object, c->freelist); set_freepointer(s, object, c->freelist);
if (unlikely(!this_cpu_cmpxchg_double( if (unlikely(!this_cpu_cmpxchg_double(
......
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