diff options
author | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-31 19:26:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 20:49:29 -0400 |
commit | 3eaa73bde2fb475b731a0fde7dd11c3ecfb8679c (patch) | |
tree | 23c087b9be927d334c3eb3b08f746a8675dae3b9 | |
parent | cb79295e20a8088a2fd6a9b3cb5f2d889ec36b4d (diff) |
arm: use clear_tasks_mm_cpumask()
Checking for process->mm is not enough because process' main thread may
exit or detach its mm via use_mm(), but other threads may still have a
valid mm.
To fix this we would need to use find_lock_task_mm(), which would walk up
all threads and returns an appropriate task (with task lock held).
clear_tasks_mm_cpumask() has this issue fixed, so let's use it.
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/arm/kernel/smp.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index b735521a4a54..2c7217d971db 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -109,7 +109,6 @@ static void percpu_timer_stop(void); | |||
109 | int __cpu_disable(void) | 109 | int __cpu_disable(void) |
110 | { | 110 | { |
111 | unsigned int cpu = smp_processor_id(); | 111 | unsigned int cpu = smp_processor_id(); |
112 | struct task_struct *p; | ||
113 | int ret; | 112 | int ret; |
114 | 113 | ||
115 | ret = platform_cpu_disable(cpu); | 114 | ret = platform_cpu_disable(cpu); |
@@ -139,12 +138,7 @@ int __cpu_disable(void) | |||
139 | flush_cache_all(); | 138 | flush_cache_all(); |
140 | local_flush_tlb_all(); | 139 | local_flush_tlb_all(); |
141 | 140 | ||
142 | read_lock(&tasklist_lock); | 141 | clear_tasks_mm_cpumask(cpu); |
143 | for_each_process(p) { | ||
144 | if (p->mm) | ||
145 | cpumask_clear_cpu(cpu, mm_cpumask(p->mm)); | ||
146 | } | ||
147 | read_unlock(&tasklist_lock); | ||
148 | 142 | ||
149 | return 0; | 143 | return 0; |
150 | } | 144 | } |