Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753508Ab3JULpG (ORCPT ); Mon, 21 Oct 2013 07:45:06 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:44876 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753471Ab3JULpE (ORCPT ); Mon, 21 Oct 2013 07:45:04 -0400 Subject: [PATCH 2/3] sched: Fix asymmetric scheduling for POWER7 To: Peter Zijlstra , Mike Galbraith , Paul Turner , Ingo Molnar From: Vaidyanathan Srinivasan Cc: Michael Neuling , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, Anton Blanchard , Preeti U Murthy , linuxppc-dev@lists.ozlabs.org Date: Mon, 21 Oct 2013 17:14:52 +0530 Message-ID: <20131021114452.13291.19947.stgit@drishya> In-Reply-To: <20131021114002.13291.31478.stgit@drishya> References: <20131021114002.13291.31478.stgit@drishya> User-Agent: StGit/0.15 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13102111-9264-0000-0000-000004C3B4DD Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 46 Asymmetric scheduling within a core is a scheduler loadbalancing feature that is triggered when SD_ASYM_PACKING flag is set. The goal for the load balancer is to move tasks to lower order idle SMT threads within a core on a POWER7 system. In nohz_kick_needed(), we intend to check if our sched domain (core) is completely busy or we have idle cpu. The following check for SD_ASYM_PACKING: (cpumask_first_and(nohz.idle_cpus_mask, sched_domain_span(sd)) < cpu) already covers the case of checking if the domain has an idle cpu, because cpumask_first_and() will not yield any set bits if this domain has no idle cpu. Hence, nr_busy check against group weight can be removed. Reported-by: Michael Neuling Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Preeti U Murthy --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 12f0eab..828ed97 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5821,8 +5821,8 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu) goto need_kick_unlock; } - if (sd->flags & SD_ASYM_PACKING && nr_busy != sg->group_weight - && (cpumask_first_and(nohz.idle_cpus_mask, + if (sd->flags & SD_ASYM_PACKING && + (cpumask_first_and(nohz.idle_cpus_mask, sched_domain_span(sd)) < cpu)) goto need_kick_unlock; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/