]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.xen/769-evtchn-CPU-offline.patch
Updated xen patches taken from suse.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.xen / 769-evtchn-CPU-offline.patch
1 From: 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
7 Subject: evtchn: Fix CPU offlining to switch all affected ports
8 belonging to a particular /dev/evcthn user.
9 Patch-mainline: obsolete
10
11 Original patch by James Harper <james.harper@bendigoit.com.au>
12
13 Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
14 Acked-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;