lkml.org 
[lkml]   [2011]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH next/mmotm] slub: partly fix freeze in __slab_free

Subject: slub: disable interrupts in cmpxchg_double_slab when falling back to pagelock.

Disable interrupts when falling back to the use of the page lock in
cmpxchg_double_slab().

Becomes necessary since __slab_free will call cmpxchg_double_slab without disabling
interrupts.

A bit bad because the invocations from the allocation path of cmpxchg_double_slab
occur with interrupts already disabled (but there are plans to enable
interrupts there as well in the future).

Signed-off-by: Christoph Lameter <cl@linux.com>


---
mm/slub.c | 5 +++++
1 file changed, 5 insertions(+)
Index: linux-2.6/mm/slub.c
===================================================================
--- linux-2.6.orig/mm/slub.c 2011-07-13 10:51:07.867138834 -0500
+++ linux-2.6/mm/slub.c 2011-07-13 10:51:20.957138752 -0500
@@ -368,14 +368,19 @@ static inline bool cmpxchg_double_slab(s
} else
#endif
{
+ unsigned long flags;
+
+ local_irq_save(flags);
slab_lock(page);
if (page->freelist == freelist_old && page->counters == counters_old) {
page->freelist = freelist_new;
page->counters = counters_new;
slab_unlock(page);
+ local_irq_restore(flags);
return 1;
}
slab_unlock(page);
+ local_irq_restore(flags);
}

cpu_relax();

\
 
 \ /
  Last update: 2011-07-13 17:57    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site