Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27390bc335ff86d92c3819cc28035fde23d1a9c2 Commit: 27390bc335ff86d92c3819cc28035fde23d1a9c2 Parent: ac140a8f8396504b33ddafb7309feca77bff8497 Author: Christoph Lameter <[EMAIL PROTECTED]> AuthorDate: Fri Jun 1 00:47:09 2007 -0700 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Fri Jun 1 08:18:30 2007 -0700
SLUB: fix locking for hotplug callbacks Hotplug callbacks are performed with interrupts enabled. Slub requires interrupts to be disabled for flushing caches. Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> Cc: Michal Piotrowski <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- mm/slub.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 238c5a6..51663a3 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2608,6 +2608,19 @@ static void for_all_slabs(void (*func)(struct kmem_cache *, int), int cpu) } /* + * 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. */ @@ -2621,7 +2634,7 @@ static int __cpuinit slab_cpuup_callback(struct notifier_block *nfb, 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; - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html