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

[Xen-changelog] [linux-2.6.18-xen] evtchn: Fix CPU offlining to switch all affected ports belonging to a



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1231154982 0
# Node ID 79e82ae1bad02c0dfb504db3153599e52a0affb3
# Parent  cfb171ddbb333df9671a1da62e40122a56213ab4
evtchn: Fix CPU offlining to switch all affected ports belonging to a
particular /dev/evcthn user.

Original patch by James Harper <james.harper@xxxxxxxxxxxxxxxx>

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 drivers/xen/evtchn/evtchn.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r cfb171ddbb33 -r 79e82ae1bad0 drivers/xen/evtchn/evtchn.c
--- a/drivers/xen/evtchn/evtchn.c       Mon Jan 05 10:54:36 2009 +0000
+++ b/drivers/xen/evtchn/evtchn.c       Mon Jan 05 11:29:42 2009 +0000
@@ -497,20 +497,22 @@ static int __cpuinit evtchn_cpu_notify(s
 {
        int hotcpu = (unsigned long)hcpu;
        cpumask_t map = cpu_online_map;
-       int port, newcpu;
+       int i, j, newcpu;
        struct per_user_data *u;
 
        switch (action) {
        case CPU_DOWN_PREPARE:
                cpu_clear(hotcpu, map);
                spin_lock_irq(&port_user_lock);
-               for (port = 0; port < NR_EVENT_CHANNELS; port++) {
-                       if ((u = port_user[port]) != NULL && 
-                           u->bind_cpu == hotcpu &&
-                           (newcpu = next_bind_cpu(map)) < NR_CPUS) {
-                               rebind_evtchn_to_cpu(port, newcpu);
-                               u->bind_cpu = newcpu;
-                       }
+               for (i = 0; i < NR_EVENT_CHANNELS; i++) {
+                       u = port_user[i];
+                       if ((u == NULL) || (u->bind_cpu != hotcpu))
+                               continue;
+                       newcpu = next_bind_cpu(map);
+                       for (j = i; j < NR_EVENT_CHANNELS; j++)
+                               if (port_user[j] == u)
+                                       rebind_evtchn_to_cpu(j, newcpu);
+                       u->bind_cpu = newcpu;
                }
                spin_unlock_irq(&port_user_lock);
                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®.