mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
slub: Disable interrupts in free_debug processing
We will be calling free_debug_processing with interrupts disabled in some case when the later patches are applied. Some of the functions called by free_debug_processing expect interrupts to be off. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
parent
881db7fb03
commit
5c2e4bbbd6
14
mm/slub.c
14
mm/slub.c
@ -1040,6 +1040,10 @@ static noinline int alloc_debug_processing(struct kmem_cache *s, struct page *pa
|
|||||||
static noinline int free_debug_processing(struct kmem_cache *s,
|
static noinline int free_debug_processing(struct kmem_cache *s,
|
||||||
struct page *page, void *object, unsigned long addr)
|
struct page *page, void *object, unsigned long addr)
|
||||||
{
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
local_irq_save(flags);
|
||||||
slab_lock(page);
|
slab_lock(page);
|
||||||
|
|
||||||
if (!check_slab(s, page))
|
if (!check_slab(s, page))
|
||||||
@ -1056,7 +1060,7 @@ static noinline int free_debug_processing(struct kmem_cache *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!check_object(s, page, object, SLUB_RED_ACTIVE))
|
if (!check_object(s, page, object, SLUB_RED_ACTIVE))
|
||||||
return 0;
|
goto out;
|
||||||
|
|
||||||
if (unlikely(s != page->slab)) {
|
if (unlikely(s != page->slab)) {
|
||||||
if (!PageSlab(page)) {
|
if (!PageSlab(page)) {
|
||||||
@ -1077,13 +1081,15 @@ static noinline int free_debug_processing(struct kmem_cache *s,
|
|||||||
set_track(s, object, TRACK_FREE, addr);
|
set_track(s, object, TRACK_FREE, addr);
|
||||||
trace(s, page, object, 0);
|
trace(s, page, object, 0);
|
||||||
init_object(s, object, SLUB_RED_INACTIVE);
|
init_object(s, object, SLUB_RED_INACTIVE);
|
||||||
|
rc = 1;
|
||||||
|
out:
|
||||||
slab_unlock(page);
|
slab_unlock(page);
|
||||||
return 1;
|
local_irq_restore(flags);
|
||||||
|
return rc;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
slab_fix(s, "Object at 0x%p not freed", object);
|
slab_fix(s, "Object at 0x%p not freed", object);
|
||||||
slab_unlock(page);
|
goto out;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init setup_slub_debug(char *str)
|
static int __init setup_slub_debug(char *str)
|
||||||
|
Loading…
Reference in New Issue
Block a user