From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbbJTJfu (ORCPT ); Tue, 20 Oct 2015 05:35:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49835 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752911AbbJTJfq (ORCPT ); Tue, 20 Oct 2015 05:35:46 -0400 Date: Tue, 20 Oct 2015 02:35:05 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: efault@gmx.de, tj@kernel.org, riel@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, peterz@infradead.org, tglx@linutronix.de, vkuznets@redhat.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, oleg@redhat.com, mingo@kernel.org Reply-To: oleg@redhat.com, mingo@kernel.org, vkuznets@redhat.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, hpa@zytor.com, peterz@infradead.org, tglx@linutronix.de, efault@gmx.de, riel@redhat.com, tj@kernel.org In-Reply-To: <20151010185315.GA24100@redhat.com> References: <20151010185315.GA24100@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched: Don't scan all-offline -> cpus_allowed twice if !CONFIG_CPUSETS Git-Commit-ID: e73e85f0593832aa583b252f9a16cf90ed6d30fa X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e73e85f0593832aa583b252f9a16cf90ed6d30fa Gitweb: http://git.kernel.org/tip/e73e85f0593832aa583b252f9a16cf90ed6d30fa Author: Oleg Nesterov AuthorDate: Sat, 10 Oct 2015 20:53:15 +0200 Committer: Ingo Molnar CommitDate: Tue, 20 Oct 2015 10:25:57 +0200 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Linus Torvalds Cc: Mike Galbraith Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Rik van Riel Cc: Tejun Heo Cc: Thomas Gleixner Cc: Vitaly Kuznetsov Cc: heiko.carstens@de.ibm.com Link: http://lkml.kernel.org/r/20151010185315.GA24100@redhat.com Signed-off-by: Ingo Molnar --- kernel/sched/core.c | 12 +++++++----- 1 file 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;