Magellan Linux

Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1030-2.6.25-xen-patch-2.6.25-rc8-rc9.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 609 - (show annotations) (download)
Fri May 23 17:35:37 2008 UTC (15 years, 11 months ago) by niro
File size: 4646 byte(s)
-using opensuse xen patchset, updated kernel configs

1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.25-rc9
3
4 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
5
6 Automatically created from "patches.kernel.org/patch-2.6.25-rc8-rc9" by xen-port-patches.py
7 Acked-by: jbeulich@novell.com
8
9 Index: head-2008-04-15/arch/x86/kernel/process_32-xen.c
10 ===================================================================
11 --- head-2008-04-15.orig/arch/x86/kernel/process_32-xen.c 2008-04-15 10:47:33.000000000 +0200
12 +++ head-2008-04-15/arch/x86/kernel/process_32-xen.c 2008-04-15 10:47:44.000000000 +0200
13 @@ -86,7 +86,6 @@ unsigned long thread_saved_pc(struct tas
14 */
15 void (*pm_idle)(void);
16 EXPORT_SYMBOL(pm_idle);
17 -static DEFINE_PER_CPU(unsigned int, cpu_idle_state);
18
19 void disable_hlt(void)
20 {
21 @@ -177,9 +176,6 @@ void cpu_idle(void)
22 while (!need_resched()) {
23 void (*idle)(void);
24
25 - if (__get_cpu_var(cpu_idle_state))
26 - __get_cpu_var(cpu_idle_state) = 0;
27 -
28 check_pgt_cache();
29 rmb();
30 idle = xen_idle; /* no alternatives */
31 @@ -204,40 +200,19 @@ static void do_nothing(void *unused)
32 {
33 }
34
35 +/*
36 + * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
37 + * pm_idle and update to new pm_idle value. Required while changing pm_idle
38 + * handler on SMP systems.
39 + *
40 + * Caller must have changed pm_idle to the new value before the call. Old
41 + * pm_idle value will not be used by any CPU after the return of this function.
42 + */
43 void cpu_idle_wait(void)
44 {
45 - unsigned int cpu, this_cpu = get_cpu();
46 - cpumask_t map, tmp = current->cpus_allowed;
47 -
48 - set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
49 - put_cpu();
50 -
51 - cpus_clear(map);
52 - for_each_online_cpu(cpu) {
53 - per_cpu(cpu_idle_state, cpu) = 1;
54 - cpu_set(cpu, map);
55 - }
56 -
57 - __get_cpu_var(cpu_idle_state) = 0;
58 -
59 - wmb();
60 - do {
61 - ssleep(1);
62 - for_each_online_cpu(cpu) {
63 - if (cpu_isset(cpu, map) && !per_cpu(cpu_idle_state, cpu))
64 - cpu_clear(cpu, map);
65 - }
66 - cpus_and(map, map, cpu_online_map);
67 - /*
68 - * We waited 1 sec, if a CPU still did not call idle
69 - * it may be because it is in idle and not waking up
70 - * because it has nothing to do.
71 - * Give all the remaining CPUS a kick.
72 - */
73 - smp_call_function_mask(map, do_nothing, NULL, 0);
74 - } while (!cpus_empty(map));
75 -
76 - set_cpus_allowed(current, tmp);
77 + smp_mb();
78 + /* kick all the CPUs so that they exit out of pm_idle */
79 + smp_call_function(do_nothing, NULL, 0, 1);
80 }
81 EXPORT_SYMBOL_GPL(cpu_idle_wait);
82
83 Index: head-2008-04-15/arch/x86/kernel/process_64-xen.c
84 ===================================================================
85 --- head-2008-04-15.orig/arch/x86/kernel/process_64-xen.c 2008-04-15 10:47:33.000000000 +0200
86 +++ head-2008-04-15/arch/x86/kernel/process_64-xen.c 2008-04-15 10:47:44.000000000 +0200
87 @@ -72,7 +72,6 @@ EXPORT_SYMBOL(boot_option_idle_override)
88 */
89 void (*pm_idle)(void);
90 EXPORT_SYMBOL(pm_idle);
91 -static DEFINE_PER_CPU(unsigned int, cpu_idle_state);
92
93 static ATOMIC_NOTIFIER_HEAD(idle_notifier);
94
95 @@ -171,9 +170,6 @@ void cpu_idle(void)
96 while (!need_resched()) {
97 void (*idle)(void);
98
99 - if (__get_cpu_var(cpu_idle_state))
100 - __get_cpu_var(cpu_idle_state) = 0;
101 -
102 rmb();
103 idle = xen_idle; /* no alternatives */
104 if (cpu_is_offline(smp_processor_id()))
105 @@ -203,40 +199,19 @@ static void do_nothing(void *unused)
106 {
107 }
108
109 +/*
110 + * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
111 + * pm_idle and update to new pm_idle value. Required while changing pm_idle
112 + * handler on SMP systems.
113 + *
114 + * Caller must have changed pm_idle to the new value before the call. Old
115 + * pm_idle value will not be used by any CPU after the return of this function.
116 + */
117 void cpu_idle_wait(void)
118 {
119 - unsigned int cpu, this_cpu = get_cpu();
120 - cpumask_t map, tmp = current->cpus_allowed;
121 -
122 - set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
123 - put_cpu();
124 -
125 - cpus_clear(map);
126 - for_each_online_cpu(cpu) {
127 - per_cpu(cpu_idle_state, cpu) = 1;
128 - cpu_set(cpu, map);
129 - }
130 -
131 - __get_cpu_var(cpu_idle_state) = 0;
132 -
133 - wmb();
134 - do {
135 - ssleep(1);
136 - for_each_online_cpu(cpu) {
137 - if (cpu_isset(cpu, map) && !per_cpu(cpu_idle_state, cpu))
138 - cpu_clear(cpu, map);
139 - }
140 - cpus_and(map, map, cpu_online_map);
141 - /*
142 - * We waited 1 sec, if a CPU still did not call idle
143 - * it may be because it is in idle and not waking up
144 - * because it has nothing to do.
145 - * Give all the remaining CPUS a kick.
146 - */
147 - smp_call_function_mask(map, do_nothing, 0, 0);
148 - } while (!cpus_empty(map));
149 -
150 - set_cpus_allowed(current, tmp);
151 + smp_mb();
152 + /* kick all the CPUs so that they exit out of pm_idle */
153 + smp_call_function(do_nothing, NULL, 0, 1);
154 }
155 EXPORT_SYMBOL_GPL(cpu_idle_wait);
156