Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp314858pxy; Thu, 22 Apr 2021 02:49:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1q9xdkaSo4/4vDi/EQtIeKIUKbQIrS2xpWeyVCP5AbquN1zYuL60EZkHoK5zyi0S13H16 X-Received: by 2002:a17:907:20f0:: with SMTP id rh16mr2612293ejb.320.1619084996283; Thu, 22 Apr 2021 02:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619084996; cv=none; d=google.com; s=arc-20160816; b=hF9K9tTRepwXDSVZbjRCIE+ZXiKBQACL8Fw0HwhZPZuMvtbyNt9MzweHOSDhFlwBQv kmZo+U4Bk3Wlp3d9z66p3MQGJQFaIyFcj1xS4tkr9BvjdHWgI/VF4TtGn24prJXEWqk0 JrTzQBtpjdrpz4YkC3+8w34msddwbfaD6CIemN7rN25mAdWGQbHXK60EyDNBU4ZeT4qj I0bvTsmYNW1Qm5oCYpP6PgVx5KkHtwRzUixvh4d7XMSanUREmq7fX2tZT5YE6I+PB/Zz wWyMxWmIjON5EML1UMU2aO0lUf1/Xc9gTNzzQWbwmB1TnADeaTfgdAp7tKQXo2ZGda6i uKyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=PU1vLgb8qNRgimyPCDxABZw+JKA+ywAuZIPa9+XEkiY=; b=xDeFt8yVunLko5bpQIX6swOZhs5MFCPJsHGway8Y/LUvIokpl3QottjcE+t0stFvAd 0XFvFoVjaoCPuMaEU3Stv+hAxus7m75wbI5TVQKEAelpXSSTkhz0A9o8+22YfKMT1McE wBn3IekMzStSTL0KmS8pPLpaN2YsXCP16UxYi+iTdCVj2+mESbGskmE8KRpDaubg59p0 j+NpnGXsvjoQCD/DPgU9TLNyKGdG1EfWVc9ar7X9aQ4K4yHrV9BH53lhvQyI0nDZCDrc 8aQQJDsBG/9L3Kz4OFbdBROhBoI4Rsg3Yo4qgtmEwH+4/OVNvWLMsRtkMr9GfbM3hTqH z7LA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si1790439eju.403.2021.04.22.02.49.32; Thu, 22 Apr 2021 02:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235583AbhDVJtS (ORCPT + 99 others); Thu, 22 Apr 2021 05:49:18 -0400 Received: from foss.arm.com ([217.140.110.172]:49160 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235824AbhDVJtQ (ORCPT ); Thu, 22 Apr 2021 05:49:16 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C691B11D4; Thu, 22 Apr 2021 02:48:41 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 82AA53F774; Thu, 22 Apr 2021 02:48:39 -0700 (PDT) Subject: Re: [PATCH 1/2] sched/fair: Filter out locally-unsolvable misfit imbalances To: Valentin Schneider , linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Ingo Molnar , Vincent Guittot , Morten Rasmussen , Qais Yousef , Quentin Perret , Pavan Kondeti , Rik van Riel , Lingutla Chandrasekhar References: <20210415175846.494385-1-valentin.schneider@arm.com> <20210415175846.494385-2-valentin.schneider@arm.com> From: Dietmar Eggemann Message-ID: <519f7b86-851b-24f7-39aa-4bbdce5c7cd3@arm.com> Date: Thu, 22 Apr 2021 11:48:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210415175846.494385-2-valentin.schneider@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/04/2021 19:58, Valentin Schneider wrote: [...] > Aggregate a misfit task's load into sgs->group_misfit_task_load only if > env->dst_cpu would grant it a capacity uplift. > > Note that the aforementioned capacity vs sgc->max_capacity comparison was > meant to prevent misfit task downmigration: candidate groups classified as > group_misfit_task but with a higher (max) CPU capacity than the destination CPU > would be discarded. This change makes it so said group_misfit_task > classification can't happen anymore, which may cause some undesired > downmigrations. > > Further tweak find_busiest_queue() to ensure this doesn't happen. Maybe you can describe shortly here what's the new mechanism is you replace the old 'prevent misfit task downmigration' with. Also note > find_busiest_queue() can now iterate over CPUs with a higher capacity than > the local CPU's, so add a capacity check there. [...] > +static inline void update_sg_lb_misfit_stats(struct lb_env *env, > + struct sched_group *group, Seems to be not used. > + struct sg_lb_stats *sgs, > + int *sg_status, > + int cpu) > +{ > + struct rq *rq = cpu_rq(cpu); > + > + if (!(env->sd->flags & SD_ASYM_CPUCAPACITY) || > + !rq->misfit_task_load) > + return; > + > + *sg_status |= SG_OVERLOAD; > + > + /* > + * Don't attempt to maximize load for misfit tasks that can't be > + * granted a CPU capacity uplift. > + */ > + if (cpu_capacity_greater(env->dst_cpu, cpu)) { > + sgs->group_misfit_task_load = max( > + sgs->group_misfit_task_load, > + rq->misfit_task_load); > + } > + > +} > + [...] > @@ -9288,6 +9310,8 @@ static struct sched_group *find_busiest_group(struct lb_env *env) > if (!sds.busiest) > goto out_balanced; > > + env->src_grp_type = busiest->group_type; Maybe a short comment why you set it here in fbg(). It's only used later in fbq() for asym. CPU capacity sd but is set unconditionally. [...]