aboutsummaryrefslogtreecommitdiffstats
path: root/arch/metag
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2013-06-28 11:09:47 -0400
committerJames Hogan <james.hogan@imgtec.com>2013-07-02 06:03:51 -0400
commit42748752f6ada54faa4f39fa471dabce62eaa79a (patch)
tree9022ca4c9be0704c4632caf15cab2615e2260ffd /arch/metag
parent5a88130a2aac2bf02d3c50abc7e65ebac11a4fd4 (diff)
metag: 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() was introduced in v3.5-rc1 to fix this issue, so let's use it for metag too. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Diffstat (limited to 'arch/metag')
-rw-r--r--arch/metag/kernel/smp.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c
index 86fdda4a85c4..b81351538c48 100644
--- a/arch/metag/kernel/smp.c
+++ b/arch/metag/kernel/smp.c
@@ -276,7 +276,6 @@ static DECLARE_COMPLETION(cpu_killed);
276int __cpuexit __cpu_disable(void) 276int __cpuexit __cpu_disable(void)
277{ 277{
278 unsigned int cpu = smp_processor_id(); 278 unsigned int cpu = smp_processor_id();
279 struct task_struct *p;
280 279
281 /* 280 /*
282 * Take this CPU offline. Once we clear this, we can't return, 281 * Take this CPU offline. Once we clear this, we can't return,
@@ -296,12 +295,7 @@ int __cpuexit __cpu_disable(void)
296 flush_cache_all(); 295 flush_cache_all();
297 local_flush_tlb_all(); 296 local_flush_tlb_all();
298 297
299 read_lock(&tasklist_lock); 298 clear_tasks_mm_cpumask(cpu);
300 for_each_process(p) {
301 if (p->mm)
302 cpumask_clear_cpu(cpu, mm_cpumask(p->mm));
303 }
304 read_unlock(&tasklist_lock);
305 299
306 return 0; 300 return 0;
307} 301}