aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-04-04 21:11:07 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-19 13:44:58 -0400
commitf9a86fcbbb1e5542eabf45c9144ac4b6330861a4 (patch)
tree0a3f8d57969b2dc8d2663e05d6ee36f9b50ba26a /kernel/sched.c
parentf70316dace2bb99730800d47044acb818c6735f6 (diff)
cpuset: modify cpuset_set_cpus_allowed to use cpumask pointer
* Modify cpuset_cpus_allowed to return the currently allowed cpuset via a pointer argument instead of as the function return value. * Use new set_cpus_allowed_ptr function. * Cleanup CPU_MASK_ALL and NODE_MASK_ALL uses. Depends on: [sched-devel]: sched: add new set_cpus_allowed_ptr function Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
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.