diff options
author | Christoph Lameter <cl@linux.com> | 2011-06-01 19:25:54 +0200 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-07-02 12:26:55 +0200 |
commit | 5c2e4bbbd60623f1024a753c291b666068f8a6e7 (patch) | |
tree | b1df70e32d94de20d5c12202250b6e45124435bb | |
parent | slub: Invert locking and avoid slab lock (diff) | |
download | linux-5c2e4bbbd60623f1024a753c291b666068f8a6e7.tar.xz linux-5c2e4bbbd60623f1024a753c291b666068f8a6e7.zip |
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>
-rw-r--r-- | mm/slub.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mm/slub.c b/mm/slub.c index ee70c091e577..08c57a047548 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1040,6 +1040,10 @@ bad: static noinline int free_debug_processing(struct kmem_cache *s, struct page *page, void *object, unsigned long addr) { + unsigned long flags; + int rc = 0; + + local_irq_save(flags); slab_lock(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)) - return 0; + goto out; if (unlikely(s != page->slab)) { if (!PageSlab(page)) { @@ -1077,13 +1081,15 @@ static noinline int free_debug_processing(struct kmem_cache *s, set_track(s, object, TRACK_FREE, addr); trace(s, page, object, 0); init_object(s, object, SLUB_RED_INACTIVE); + rc = 1; +out: slab_unlock(page); - return 1; + local_irq_restore(flags); + return rc; fail: slab_fix(s, "Object at 0x%p not freed", object); - slab_unlock(page); - return 0; + goto out; } static int __init setup_slub_debug(char *str) |