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

From
Peter Zijlstra <hidden>
Date
2012-03-24 12:45:09
Also in
linux-arm-kernel, linux-mm, linux-sh, linux-um, lkml
Reply to
Anton Vorontsov, 2012-03-24
On Sat, 2012-03-24 at 14:27 +0400, Anton Vorontsov wrote:
quoted hunk ↗ jump to hunk
+void clear_tasks_mm_cpumask(int cpu)
+{
+       struct task_struct *p;
+
+       read_lock(&tasklist_lock);
+       for_each_process(p) {
+               struct task_struct *t;
+
+               t =3D find_lock_task_mm(p);
+               if (!t)
+                       continue;
+               cpumask_clear_cpu(cpu, mm_cpumask(t->mm));
+               task_unlock(t);
+       }
+       read_unlock(&tasklist_lock);
+}=20
Why bother with the tasklist_lock at all anymore, afaict you could use
rcu_read_lock() here. This all is called after the cpu is taken down and
marked offline, so its not like new tasks will ever get this cpu set in
their mm mask.
Thread (27 messages) 27 messages, 6 authors, last reply 2012-03-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help