Skip to content

Commit

Permalink
slub: When allocating a new slab also prep the first object
Browse files Browse the repository at this point in the history
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: Rabin Vincent <rabin@rab.in>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Jul 25, 2011
1 parent 1d07171 commit 9e577e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,9 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
stat(s, ALLOC_SLAB);
c->node = page_to_nid(page);
c->page = page;

if (kmem_cache_debug(s))
goto debug;
goto load_freelist;
}
if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
Expand Down

0 comments on commit 9e577e8

Please sign in to comment.