From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758839AbdEVURW (ORCPT ); Mon, 22 May 2017 16:17:22 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40938 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751376AbdEVURU (ORCPT ); Mon, 22 May 2017 16:17:20 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 88F70607C8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=austinwc@codeaurora.org Subject: Re: [PATCH V3 0/2] load_balance() fixes for affinity To: Peter Zijlstra , Jeffrey Hugo Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Dietmar Eggemann , Tyler Baicar , Timur Tabi References: <1495136163-27440-1-git-send-email-jhugo@codeaurora.org> <20170522155217.zq3t6gkfu246ydxi@hirez.programming.kicks-ass.net> From: "Christ, Austin" Message-ID: <8716629f-6ccb-bfa1-62d5-3fee6b9f9316@codeaurora.org> Date: Mon, 22 May 2017 14:17:17 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170522155217.zq3t6gkfu246ydxi@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Peter, On 5/22/2017 9:52 AM, Peter Zijlstra wrote: > On Thu, May 18, 2017 at 01:36:01PM -0600, Jeffrey Hugo wrote: > >> The group_imbalance path correctly sets the flag >> to indicate the group can not be properly balanced due to affinity, but the >> redo condition right after this branch incorrectly assumes that there may >> be other cores with work to be pulled by considering cores outside of the >> scheduling domain in question. > So its been a while since I looked at any of this, but from a quick > look, env->cpus appears to only be applied to group/balance masks. > > In which case, we can easily do something like the below. Did I miss > something? We have looked through and agree with your proposed change; however, we would still need to mask out the dst_cpu when considering the redo path. We will include this modification in the next patch set. > > --- > kernel/sched/fair.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 219fe58e3023..1724e4433f89 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -8104,7 +8104,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, > if (idle == CPU_NEWLY_IDLE) > env.dst_grpmask = NULL; > > - cpumask_copy(cpus, cpu_active_mask); > + cpumask_and(cpus, sched_domain_span(sd), cpu_active_mask); > > schedstat_inc(sd->lb_count[idle]); > -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.