aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-06-25 15:45:46 +0200
committerIngo Molnar <mingo@elte.hu>2011-10-06 12:47:00 +0200
commit4939602a2441306008c6dca38216b741d4e09a42 (patch)
treee22218b6291c934944c8860dedb9f37ffd452ac4 /kernel/sched.c
parentsched: Wrap scheduler p->cpus_allowed access (diff)
downloadlinux-dev-4939602a2441306008c6dca38216b741d4e09a42.tar.xz
linux-dev-4939602a2441306008c6dca38216b741d4e09a42.zip
sched: Unify the ->cpus_allowed mask copy
Currently every sched_class::set_cpus_allowed() implementation has to copy the cpumask into task_struct::cpus_allowed, this is pointless, put this copy in the generic code. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/n/tip-jhl5s9fckd9ptw1fzbqqlrd3@git.kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 45174ca5c8ea..ce9a9e7db116 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6161,10 +6161,9 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
{
if (p->sched_class && p->sched_class->set_cpus_allowed)
p->sched_class->set_cpus_allowed(p, new_mask);
- else {
- cpumask_copy(&p->cpus_allowed, new_mask);
- p->rt.nr_cpus_allowed = cpumask_weight(new_mask);
- }
+
+ cpumask_copy(&p->cpus_allowed, new_mask);
+ p->rt.nr_cpus_allowed = cpumask_weight(new_mask);
}
/*