diff options
-rw-r--r-- | arch/i386/kernel/process.c | 4 | ||||
-rw-r--r-- | arch/x86_64/kernel/process.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 1e1fa3e391a3..dd53c58f64f1 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -205,7 +205,7 @@ void cpu_idle(void) | |||
205 | void cpu_idle_wait(void) | 205 | void cpu_idle_wait(void) |
206 | { | 206 | { |
207 | unsigned int cpu, this_cpu = get_cpu(); | 207 | unsigned int cpu, this_cpu = get_cpu(); |
208 | cpumask_t map; | 208 | cpumask_t map, tmp = current->cpus_allowed; |
209 | 209 | ||
210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); | 210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); |
211 | put_cpu(); | 211 | put_cpu(); |
@@ -227,6 +227,8 @@ void cpu_idle_wait(void) | |||
227 | } | 227 | } |
228 | cpus_and(map, map, cpu_online_map); | 228 | cpus_and(map, map, cpu_online_map); |
229 | } while (!cpus_empty(map)); | 229 | } while (!cpus_empty(map)); |
230 | |||
231 | set_cpus_allowed(current, tmp); | ||
230 | } | 232 | } |
231 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 233 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
232 | 234 | ||
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index f6226055d53d..7451a4c43c16 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -144,7 +144,7 @@ static void poll_idle (void) | |||
144 | void cpu_idle_wait(void) | 144 | void cpu_idle_wait(void) |
145 | { | 145 | { |
146 | unsigned int cpu, this_cpu = get_cpu(); | 146 | unsigned int cpu, this_cpu = get_cpu(); |
147 | cpumask_t map; | 147 | cpumask_t map, tmp = current->cpus_allowed; |
148 | 148 | ||
149 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); | 149 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); |
150 | put_cpu(); | 150 | put_cpu(); |
@@ -167,6 +167,8 @@ void cpu_idle_wait(void) | |||
167 | } | 167 | } |
168 | cpus_and(map, map, cpu_online_map); | 168 | cpus_and(map, map, cpu_online_map); |
169 | } while (!cpus_empty(map)); | 169 | } while (!cpus_empty(map)); |
170 | |||
171 | set_cpus_allowed(current, tmp); | ||
170 | } | 172 | } |
171 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 173 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
172 | 174 | ||