|
@@ -5946,13 +5946,15 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
|
|
|
|
|
|
rq = task_rq_lock(p, &flags);
|
|
rq = task_rq_lock(p, &flags);
|
|
|
|
|
|
|
|
+ if (cpumask_equal(&p->cpus_allowed, new_mask))
|
|
|
|
+ goto out;
|
|
|
|
+
|
|
if (!cpumask_intersects(new_mask, cpu_active_mask)) {
|
|
if (!cpumask_intersects(new_mask, cpu_active_mask)) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
- if (unlikely((p->flags & PF_THREAD_BOUND) && p != current &&
|
|
|
|
- !cpumask_equal(&p->cpus_allowed, new_mask))) {
|
|
|
|
|
|
+ if (unlikely((p->flags & PF_THREAD_BOUND) && p != current)) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|