]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.xen/769-evtchn-CPU-offline.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.xen / 769-evtchn-CPU-offline.patch
CommitLineData
2cb7cef9
BS
1From: http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/79e82ae1bad0
2# HG changeset 769 patch
3# User Keir Fraser <keir.fraser@citrix.com>
4# Date 1231154982 0
5# Node ID 79e82ae1bad02c0dfb504db3153599e52a0affb3
6# Parent cfb171ddbb333df9671a1da62e40122a56213ab4
7Subject: evtchn: Fix CPU offlining to switch all affected ports
8belonging to a particular /dev/evcthn user.
9Patch-mainline: obsolete
10
11Original patch by James Harper <james.harper@bendigoit.com.au>
12
13Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14Acked-by: jbeulich@novell.com
15
16--- head-2009-01-06.orig/drivers/xen/evtchn/evtchn.c 2008-09-01 12:20:11.000000000 +0200
17+++ head-2009-01-06/drivers/xen/evtchn/evtchn.c 2009-01-05 12:29:42.000000000 +0100
18@@ -497,20 +497,22 @@ static int __cpuinit evtchn_cpu_notify(s
19 {
20 int hotcpu = (unsigned long)hcpu;
21 cpumask_t map = cpu_online_map;
22- int port, newcpu;
23+ int i, j, newcpu;
24 struct per_user_data *u;
25
26 switch (action) {
27 case CPU_DOWN_PREPARE:
28 cpu_clear(hotcpu, map);
29 spin_lock_irq(&port_user_lock);
30- for (port = 0; port < NR_EVENT_CHANNELS; port++) {
31- if ((u = port_user[port]) != NULL &&
32- u->bind_cpu == hotcpu &&
33- (newcpu = next_bind_cpu(map)) < NR_CPUS) {
34- rebind_evtchn_to_cpu(port, newcpu);
35- u->bind_cpu = newcpu;
36- }
37+ for (i = 0; i < NR_EVENT_CHANNELS; i++) {
38+ u = port_user[i];
39+ if ((u == NULL) || (u->bind_cpu != hotcpu))
40+ continue;
41+ newcpu = next_bind_cpu(map);
42+ for (j = i; j < NR_EVENT_CHANNELS; j++)
43+ if (port_user[j] == u)
44+ rebind_evtchn_to_cpu(j, newcpu);
45+ u->bind_cpu = newcpu;
46 }
47 spin_unlock_irq(&port_user_lock);
48 break;