提交 9e577e8b 编写于 作者: C Christoph Lameter 提交者: Pekka Enberg

slub: When allocating a new slab also prep the first object

We need to branch to the debug code for the first object if we allocate
a new slab otherwise the first object will be marked wrongly as inactive.
Tested-by: NRabin Vincent <rabin@rab.in>
Signed-off-by: NChristoph Lameter <cl@linux.com>
Signed-off-by: NPekka Enberg <penberg@kernel.org>
上级 1d07171c
...@@ -2082,6 +2082,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, ...@@ -2082,6 +2082,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
stat(s, ALLOC_SLAB); stat(s, ALLOC_SLAB);
c->node = page_to_nid(page); c->node = page_to_nid(page);
c->page = page; c->page = page;
if (kmem_cache_debug(s))
goto debug;
goto load_freelist; goto load_freelist;
} }
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit()) if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册