aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/process_32.c11
-rw-r--r--arch/x86/kernel/process_64.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9663c2a74830..46d391d49de8 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -204,6 +204,10 @@ void cpu_idle(void)
204 } 204 }
205} 205}
206 206
207static void do_nothing(void *unused)
208{
209}
210
207void cpu_idle_wait(void) 211void cpu_idle_wait(void)
208{ 212{
209 unsigned int cpu, this_cpu = get_cpu(); 213 unsigned int cpu, this_cpu = get_cpu();
@@ -228,6 +232,13 @@ void cpu_idle_wait(void)
228 cpu_clear(cpu, map); 232 cpu_clear(cpu, map);
229 } 233 }
230 cpus_and(map, map, cpu_online_map); 234 cpus_and(map, map, cpu_online_map);
235 /*
236 * We waited 1 sec, if a CPU still did not call idle
237 * it may be because it is in idle and not waking up
238 * because it has nothing to do.
239 * Give all the remaining CPUS a kick.
240 */
241 smp_call_function_mask(map, do_nothing, 0, 0);
231 } while (!cpus_empty(map)); 242 } while (!cpus_empty(map));
232 243
233 set_cpus_allowed(current, tmp); 244 set_cpus_allowed(current, tmp);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6309b275cb9c..ab79e1dfa023 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -135,6 +135,10 @@ static void poll_idle (void)
135 cpu_relax(); 135 cpu_relax();
136} 136}
137 137
138static void do_nothing(void *unused)
139{
140}
141
138void cpu_idle_wait(void) 142void cpu_idle_wait(void)
139{ 143{
140 unsigned int cpu, this_cpu = get_cpu(); 144 unsigned int cpu, this_cpu = get_cpu();
@@ -160,6 +164,13 @@ void cpu_idle_wait(void)
160 cpu_clear(cpu, map); 164 cpu_clear(cpu, map);
161 } 165 }
162 cpus_and(map, map, cpu_online_map); 166 cpus_and(map, map, cpu_online_map);
167 /*
168 * We waited 1 sec, if a CPU still did not call idle
169 * it may be because it is in idle and not waking up
170 * because it has nothing to do.
171 * Give all the remaining CPUS a kick.
172 */
173 smp_call_function_mask(map, do_nothing, 0, 0);
163 } while (!cpus_empty(map)); 174 } while (!cpus_empty(map));
164 175
165 set_cpus_allowed(current, tmp); 176 set_cpus_allowed(current, tmp);