aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2011-06-25 09:45:46 -0400
committerIngo Molnar <mingo@elte.hu>2011-10-06 06:47:00 -0400
commit4939602a2441306008c6dca38216b741d4e09a42 (patch)
treee22218b6291c934944c8860dedb9f37ffd452ac4 /kernel
parentfa17b507f142d37aeac322a95f6f7c6375f25601 (diff)
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')
-rw-r--r--kernel/sched.c7
-rw-r--r--kernel/sched_rt.c3
2 files changed, 3 insertions, 7 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)
6161{ 6161{
6162 if (p->sched_class && p->sched_class->set_cpus_allowed) 6162 if (p->sched_class && p->sched_class->set_cpus_allowed)
6163 p->sched_class->set_cpus_allowed(p, new_mask); 6163 p->sched_class->set_cpus_allowed(p, new_mask);
6164 else { 6164
6165 cpumask_copy(&p->cpus_allowed, new_mask); 6165 cpumask_copy(&p->cpus_allowed, new_mask);
6166 p->rt.nr_cpus_allowed = cpumask_weight(new_mask); 6166 p->rt.nr_cpus_allowed = cpumask_weight(new_mask);
6167 }
6168} 6167}
6169 6168
6170/* 6169/*
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 57a10842afa1..3023fd1ef364 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -1608,9 +1608,6 @@ static void set_cpus_allowed_rt(struct task_struct *p,
1608 1608
1609 update_rt_migration(&rq->rt); 1609 update_rt_migration(&rq->rt);
1610 } 1610 }
1611
1612 cpumask_copy(&p->cpus_allowed, new_mask);
1613 p->rt.nr_cpus_allowed = weight;
1614} 1611}
1615 1612
1616/* Assumes rq->lock is held */ 1613/* Assumes rq->lock is held */