It can race with sched_setaffinity(). It has to give up tasklist_lock as
well to call set_cpus_allowed() and can race
cpus_allowed = cpuset_cpus_allowed(p);
cpus_and(new_mask, new_mask, cpus_allowed);
retval = set_cpus_allowed(p, new_mask);
and allow a task to have a cpu outside of the cpuset's new cpus_allowed if
you've taken it away between cpuset_cpus_allowed() and set_cpus_allowed().
David
-