WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] timers: Migrate timers away from an offli

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] timers: Migrate timers away from an offlined CPU.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 May 2010 05:16:20 -0700
Delivery-date: Wed, 19 May 2010 05:22:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] timers: Migrate timers away from an offlined CPU., Xen patchbot-unstable <=