summaryrefslogtreecommitdiffstats
path: root/kernel/sched
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2015-10-10 20:53:15 +0200
committerIngo Molnar <mingo@kernel.org>2015-10-20 10:25:57 +0200
commite73e85f0593832aa583b252f9a16cf90ed6d30fa (patch)
tree596a71d44863ae338b5dc1bd07b733e5acc6afec /kernel/sched
parent62694cd51322262a9142e946915fc4783113ccff (diff)
downloadop-kernel-dev-e73e85f0593832aa583b252f9a16cf90ed6d30fa.zip
op-kernel-dev-e73e85f0593832aa583b252f9a16cf90ed6d30fa.tar.gz
sched: Don't scan all-offline ->cpus_allowed twice if !CONFIG_CPUSETS
If CONFIG_CPUSETS=n then "case cpuset" changes the state and runs the already failed for_each_cpu() loop again for no reason. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: heiko.carstens@de.ibm.com Link: http://lkml.kernel.org/r/20151010185315.GA24100@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r--kernel/sched/core.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index a7b368e..b4d263d 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1580,13 +1580,15 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
goto out;
}
+ /* No more Mr. Nice Guy. */
switch (state) {
case cpuset:
- /* No more Mr. Nice Guy. */
- cpuset_cpus_allowed_fallback(p);
- state = possible;
- break;
-
+ if (IS_ENABLED(CONFIG_CPUSETS)) {
+ cpuset_cpus_allowed_fallback(p);
+ state = possible;
+ break;
+ }
+ /* fall-through */
case possible:
do_set_cpus_allowed(p, cpu_possible_mask);
state = fail;
OpenPOWER on IntegriCloud