aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/kernel/process.c')
-rw-r--r--arch/x86_64/kernel/process.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c
index 49f7fac6229e..7451a4c43c16 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86_64/kernel/process.c
@@ -88,9 +88,8 @@ void enter_idle(void)
88 88
89static void __exit_idle(void) 89static void __exit_idle(void)
90{ 90{
91 if (read_pda(isidle) == 0) 91 if (test_and_clear_bit_pda(0, isidle) == 0)
92 return; 92 return;
93 write_pda(isidle, 0);
94 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); 93 atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
95} 94}
96 95
@@ -145,7 +144,7 @@ static void poll_idle (void)
145void cpu_idle_wait(void) 144void cpu_idle_wait(void)
146{ 145{
147 unsigned int cpu, this_cpu = get_cpu(); 146 unsigned int cpu, this_cpu = get_cpu();
148 cpumask_t map; 147 cpumask_t map, tmp = current->cpus_allowed;
149 148
150 set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); 149 set_cpus_allowed(current, cpumask_of_cpu(this_cpu));
151 put_cpu(); 150 put_cpu();
@@ -168,6 +167,8 @@ void cpu_idle_wait(void)
168 } 167 }
169 cpus_and(map, map, cpu_online_map); 168 cpus_and(map, map, cpu_online_map);
170 } while (!cpus_empty(map)); 169 } while (!cpus_empty(map));
170
171 set_cpus_allowed(current, tmp);
171} 172}
172EXPORT_SYMBOL_GPL(cpu_idle_wait); 173EXPORT_SYMBOL_GPL(cpu_idle_wait);
173 174