[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] timers: Migrate timers away from an offlined CPU.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1274266471 -3600
# Node ID 14a273565ad5e22f089e2fee8a86d5b0c760ada1
# Parent  a6f24be72f667b2a339b6412dcebe72d94d757a9
timers: Migrate timers away from an offlined CPU.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/common/timer.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff -r a6f24be72f66 -r 14a273565ad5 xen/common/timer.c
--- a/xen/common/timer.c        Wed May 19 11:39:08 2010 +0100
+++ b/xen/common/timer.c        Wed May 19 11:54:31 2010 +0100
@@ -515,6 +515,29 @@ static struct keyhandler dump_timerq_key
     .desc = "dump timer queues"
 };
 
+static void migrate_timers_from_cpu(unsigned int cpu)
+{
+    struct timers *ts;
+    struct timer *t;
+
+    ASSERT((cpu != 0) && cpu_online(0));
+
+    ts = &per_cpu(timers, cpu);
+
+    spin_lock_irq(&per_cpu(timers, 0).lock);
+    spin_lock(&ts->lock);
+
+    while ( (t = GET_HEAP_SIZE(ts->heap) ? ts->heap[1] : ts->list) != NULL )
+    {
+        remove_entry(ts, t);
+        t->cpu = 0;
+        __add_timer(t);
+    }
+
+    spin_unlock(&ts->lock);
+    spin_unlock_irq(&per_cpu(timers, 0).lock);
+}
+
 static struct timer *dummy_heap;
 
 static int cpu_callback(
@@ -531,8 +554,7 @@ static int cpu_callback(
         break;
     case CPU_UP_CANCELED:
     case CPU_DEAD:
-        /* Enable this later. */
-        /*WARN_ON(GET_HEAP_SIZE(ts->heap) || ts->list);*/
+        migrate_timers_from_cpu(cpu);
         break;
     default:
         break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.