]> err.no Git - linux-2.6/commitdiff
slab: shut down cache_reaper when cpu goes down
authorChristoph Lameter <clameter@sgi.com>
Wed, 9 May 2007 09:34:22 +0000 (02:34 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 9 May 2007 19:30:53 +0000 (12:30 -0700)
Shutdown the cache_reaper if the cpu is brought down and set the
cache_reap.func to NULL.  Otherwise hotplug shuts down the reaper for good.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/slab.c

index cceb347a354ec01e39fce84a58e2c164c99845ff..1a7a10de2a4d21737a4e89281a7d2a7b56ec214f 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1279,6 +1279,20 @@ static int __cpuinit cpuup_callback(struct notifier_block *nfb,
                start_cpu_timer(cpu);
                break;
 #ifdef CONFIG_HOTPLUG_CPU
+       case CPU_DOWN_PREPARE:
+               /*
+                * Shutdown cache reaper. Note that the cache_chain_mutex is
+                * held so that if cache_reap() is invoked it cannot do
+                * anything expensive but will only modify reap_work
+                * and reschedule the timer.
+               */
+               cancel_rearming_delayed_work(&per_cpu(reap_work, cpu));
+               /* Now the cache_reaper is guaranteed to be not running. */
+               per_cpu(reap_work, cpu).work.func = NULL;
+               break;
+       case CPU_DOWN_FAILED:
+               start_cpu_timer(cpu);
+               break;
        case CPU_DEAD:
                /*
                 * Even if all the cpus of a node are down, we don't free the