SLUB: Fix locking for hotplug callbacks. Hotplug callbacks seem to be performed with interrupts enabled. Slub requires interrupts to be disabled for flushing caches. Signed-off-by: Christoph Lameter --- mm/slub.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-06-01 15:49:50.000000000 -0700 +++ slub/mm/slub.c 2007-06-01 18:08:32.000000000 -0700 @@ -2663,6 +2663,19 @@ static void for_all_slabs(void (*func)(s } /* + * Version of __flush_cpu_slab for the case that interrupts + * are enabled. + */ +static void cpu_slab_flush(struct kmem_cache *s, int cpu) +{ + unsigned long flags; + + local_irq_save(flags); + __flush_cpu_slab(s, cpu); + local_irq_restore(flags); +} + +/* * Use the cpu notifier to insure that the cpu slabs are flushed when * necessary. */ @@ -2676,7 +2689,7 @@ static int __cpuinit slab_cpuup_callback case CPU_UP_CANCELED_FROZEN: case CPU_DEAD: case CPU_DEAD_FROZEN: - for_all_slabs(__flush_cpu_slab, cpu); + for_all_slabs(cpu_slab_flush, cpu); break; default: break;