[PATCH 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-24 Thread Anton Vorontsov
Many architctures clear tasks' mm_cpumask like this: read_lock(&tasklist_lock); for_each_process(p) { if (p->mm) cpumask_clear_cpu(cpu, mm_cpumask(p->mm)); } read_unlock(&tasklist_lock); The code above has several problems, s

Re: [PATCH 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-24 Thread Peter Zijlstra
On Sat, 2012-03-24 at 14:27 +0400, Anton Vorontsov wrote: > +void clear_tasks_mm_cpumask(int cpu) > +{ > + struct task_struct *p; > + > + read_lock(&tasklist_lock); > + for_each_process(p) { > + struct task_struct *t; > + > + t = find_lock_task_mm(p); >