aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index ef3f28b334ea..ccc23a9cd264 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4941,13 +4941,13 @@ long sched_setaffinity(pid_t pid, cpumask_t new_mask)
4941 if (retval) 4941 if (retval)
4942 goto out_unlock; 4942 goto out_unlock;
4943 4943
4944 cpus_allowed = cpuset_cpus_allowed(p); 4944 cpuset_cpus_allowed(p, &cpus_allowed);
4945 cpus_and(new_mask, new_mask, cpus_allowed); 4945 cpus_and(new_mask, new_mask, cpus_allowed);
4946 again: 4946 again:
4947 retval = set_cpus_allowed(p, new_mask); 4947 retval = set_cpus_allowed(p, new_mask);
4948 4948
4949 if (!retval) { 4949 if (!retval) {
4950 cpus_allowed = cpuset_cpus_allowed(p); 4950 cpuset_cpus_allowed(p, &cpus_allowed);
4951 if (!cpus_subset(new_mask, cpus_allowed)) { 4951 if (!cpus_subset(new_mask, cpus_allowed)) {
4952 /* 4952 /*
4953 * We must have raced with a concurrent cpuset 4953 * We must have raced with a concurrent cpuset
@@ -5661,7 +5661,9 @@ static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p)
5661 5661
5662 /* No more Mr. Nice Guy. */ 5662 /* No more Mr. Nice Guy. */
5663 if (dest_cpu >= nr_cpu_ids) { 5663 if (dest_cpu >= nr_cpu_ids) {
5664 cpumask_t cpus_allowed = cpuset_cpus_allowed_locked(p); 5664 cpumask_t cpus_allowed;
5665
5666 cpuset_cpus_allowed_locked(p, &cpus_allowed);
5665 /* 5667 /*
5666 * Try to stay on the same cpuset, where the 5668 * Try to stay on the same cpuset, where the
5667 * current cpuset may be a subset of all cpus. 5669 * current cpuset may be a subset of all cpus.