Skip to content

Commit

Permalink
slub: Fix double bit unlock in debug mode
Browse files Browse the repository at this point in the history
Commit 442b06b ("slub: Remove node check in slab_free") added a
call to deactivate_slab() in the debug case in __slab_alloc(), which
unlocks the current slab used for allocation.  Going to the label
'unlock_out' then does it again.

Also, in the debug case we do not need all the other processing that the
'unlock_out' path does.  We always fall back to the slow path in the
debug case.  So the tid update is useless.

Similarly, ALLOC_SLOWPATH would just be incremented for all allocations.
Also a pretty useless thing.

So simply restore irq flags and return the object.

Signed-off-by: Christoph Lameter <cl@linux.com>
Reported-and-bisected-by: James Morris <jmorris@namei.org>
Reported-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Jens Axboe <jaxboe@fusionio.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed May 25, 2011
1 parent 4a7df24 commit a71ae47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,8 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
deactivate_slab(s, c);
c->page = NULL;
c->node = NUMA_NO_NODE;
goto unlock_out;
local_irq_restore(flags);
return object;
}

/*
Expand Down

0 comments on commit a71ae47

Please sign in to comment.