[slubllv4 11/16] slub: Disable interrupts in free_debug processing

Christoph Lameter
2011-05-06T18:08:31Z

[-- Attachment #1: irqoff_in_free_debug_processing --]
[-- Type: text/plain, Size: 1113 bytes --]

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>

---
mm/slub.c | 6 ++++++
1 file changed, 6 insertions(+)

Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-04-15 13:15:04.000000000 -0500
+++ linux-2.6/mm/slub.c 2011-04-15 13:15:06.000000000 -0500
@@ -1023,6 +1023,10 @@ bad:
static noinline int free_debug_processing(struct kmem_cache *s,
struct page *page, void *object, unsigned long addr)
{
+ unsigned long flags;
+
+ local_irq_save(flags);
+
slab_lock(page);

if (!check_slab(s, page))
@@ -1061,11 +1065,13 @@ static noinline int free_debug_processin
trace(s, page, object, 0);
init_object(s, object, SLUB_RED_INACTIVE);
slab_unlock(page);
+ local_irq_restore(flags);
return 1;

fail:
slab_fix(s, "Object at 0x%p not freed", object);
slab_unlock(page);
+ local_irq_restore(flags);
return 0;
}