Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2969415pxb; Mon, 17 Jan 2022 09:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTzFg5sG59uZRYZVrE3PIBt/GWDLkmtgTFiuYLEeznqR7HxVVhagnIfRZ47BjaJnwT1k4G X-Received: by 2002:a17:902:e8c2:b0:149:fdf8:270 with SMTP id v2-20020a170902e8c200b00149fdf80270mr23604161plg.167.1642439474346; Mon, 17 Jan 2022 09:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439474; cv=none; d=google.com; s=arc-20160816; b=ZgY7XvlIYRKN2wfNkhTCAre5aGeMfQUfUzt2QliHEz//goZHOYyHn71XnedW7j8Ecy NrRgY+rn8l0Ykbix2Ib/Fe96g+TWvnUI93KGprwf1h0v3sRWcINQrrnvgHbnv6ZpJR0O iT6EFVyp5GGUMEEl0JLybaM786XxuGEJqWCx9lGgLAwXj1JishL9yctypNZUR/rCdpS2 ut9qXZC43CFxFD98tTrgvqrzEE0ctT4JRfxMmfG9otXUbMFbdw4IxfBulRYd4vamGRbR mM+LLPHQDFbX9KiuPYsR6D0qhmmFoDCk8aV+gVSqW+CugHPoXCo+LfSK5iOkgsf1V6Ed OLIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UFnI2n344fEXDTpdsSUOjcKjWGnGBz/iToNlRmLPe7U=; b=RNdwSj8LHTAzD0OgkIYUrQFNv0gPZ/ycSUmXXGU8W+8S0qsyLvZdqeYsfBiRjUfqbs 8tJ30Cuq/lLJi5kESsZIcswhFsqip2TD+XsFFJGlViuEw4JKdkrs7QMc6DuPQYkzrsJJ 7jsXJ83lX8xrblrsVVb9B8L0DgKsPcuq08X7JWEYyl/VeZQsUHceCig/f8U6LoYKdU3R 8xhdspQZYLNy3Yz3dFznZaxHG7aCAfC8QMwD/0UU0B467pKu09fgdQx5x2Jkx3JVW+oY XmEWru37gA6q6PE5IKukmEYuMPldrm/YpmopHTi+jtvU7RooEAOxG9pijvFXPqrZ51xp VE+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fuodsfLN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k22si4320015pls.433.2022.01.17.09.11.01; Mon, 17 Jan 2022 09:11:14 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=fuodsfLN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233715AbiAQKpr (ORCPT + 99 others); Mon, 17 Jan 2022 05:45:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232677AbiAQKpq (ORCPT ); Mon, 17 Jan 2022 05:45:46 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53E84C061574 for ; Mon, 17 Jan 2022 02:45:46 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id x11so30205813lfa.2 for ; Mon, 17 Jan 2022 02:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UFnI2n344fEXDTpdsSUOjcKjWGnGBz/iToNlRmLPe7U=; b=fuodsfLNn9z0V31KFyLWJdWRmLOJmd8d6qjy3nFUlF1g58zoZkoP7rywmgO4+FHbeE nxQTvJT3gjWFrRHKJztDzSoaxZZg+Kg6YMpWzw0GiwiGBR3z0PjE8cN/cutnAVjqoasr ajPDB6M4OXYfYKRTqgIwOCzUDufAInwT2EYKQkXO95uT0DIXiV+o/dNyt2VXdyAHMFaH elxH92Hr3LhUhgYhf8PUNVBd/ojbWU0xENhlBtiDFRFZhShkd8ayelU7D9kkCJ2nboPx mwVbCe+VXYpU2aI1nfzxNUGbMl1WNRCKYoX/D9wIZZgoOm1dv5q6dKawN+lwtrSzByOG N2Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UFnI2n344fEXDTpdsSUOjcKjWGnGBz/iToNlRmLPe7U=; b=0bWZaBPJbrjep6EYZ2MCo9HlsKXoHyTOjjk0/zD3zcEuy6BipGBkG0y31HkDTFTDqb ehnKV29+XEgKa+hfulEsaql4PBRU99vg1L2BzvHLYM2ZfRSXAJyTpRufL2s3cQCW9U/J biho7kLRhKsIqVqAqWnMPix0kKSntTTIJejsTO6jKsx+AQ2kJuFBIEH0pOh4Xh1M5K7k jw7/PzJ/CIRzsRfZT4SitVJRdJHTc0R0Jeg2CThfubCp3rE9Egd7zcisrOgxtmeUhsKh fOGMd7KZRE7CwCZwveAbcnkG+IPy5yNNS/xfPWIQY1ZeWgoi0BRCAeedy52T8JaYmqtK ivCg== X-Gm-Message-State: AOAM532Kc1ucaXt90dkgb/wF/VlRYep/tGtT0olMXeWNyzhd4xEC7hUB M/ey+DkrKALOuN2gO1x+kZh3ZzLScQMkvYixzfpB24q7XE1U3g== X-Received: by 2002:a2e:908e:: with SMTP id l14mr5020043ljg.266.1642416344654; Mon, 17 Jan 2022 02:45:44 -0800 (PST) MIME-Version: 1.0 References: <20211220114323.22811-1-vincent.donnefort@arm.com> <20211220114323.22811-4-vincent.donnefort@arm.com> In-Reply-To: From: Vincent Guittot Date: Mon, 17 Jan 2022 11:45:33 +0100 Message-ID: Subject: Re: [PATCH 3/3] sched/fair: Do not raise overutilized for idle CPUs To: Vincent Donnefort Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, Valentin.Schneider@arm.com, Morten.Rasmussen@arm.com, qperret@google.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jan 2022 at 17:40, Vincent Donnefort wrote: > > On Wed, Dec 22, 2021 at 09:20:17AM +0100, Vincent Guittot wrote: > > On Mon, 20 Dec 2021 at 12:43, Vincent Donnefort > > wrote: > > > > > > During a migration, the lock for the previous runqueue is not taken and > > > hence, the task contribution isn't directly removed from that runqueue > > > utilization but instead temporarily saved, until the next PELT signals > > > update where it would be accounted. There is then a window in which a > > > CPU can ben idle be nonetheless overutilized. > > > > > > The load balancer wouldn't be able to do anything to help a sleeping CPU, > > > it brings then no gain to raise overutilized there, only the risk of > > > spuriously doing it. > > > > But how do you make the difference between a very short idle time of > > an overutilized CPU and a idle cpu with outdated utilization > > No distinction here, but if the CPU is idle there's nothing to pull, so the load > balance wouldn't do anything with this information. The load balance has never done anything with this information. This information is only used to disable LB for EAS and as mentioned below, being idle is not a good reason for not being overutilized. Also this patch seems to be there just to fix a problem created by the previous one which triggers the costly new idle load balance without good reason > > > > > Being idle is not a good reason for not being overutilized (ie ~80% of > > average utilisation) > > > > > > > > Signed-off-by: Vincent Donnefort > > > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > > index 51f6f55abb37..37f737c5f0b8 100644 > > > --- a/kernel/sched/fair.c > > > +++ b/kernel/sched/fair.c > > > @@ -8641,26 +8641,28 @@ static inline void update_sg_lb_stats(struct lb_env *env, > > > > > > nr_running = rq->nr_running; > > > sgs->sum_nr_running += nr_running; > > > - > > > - if (nr_running > 1) > > > - *sg_status |= SG_OVERLOAD; > > > - > > > - if (cpu_overutilized(i)) > > > - *sg_status |= SG_OVERUTILIZED; > > > - > > > #ifdef CONFIG_NUMA_BALANCING > > > sgs->nr_numa_running += rq->nr_numa_running; > > > sgs->nr_preferred_running += rq->nr_preferred_running; > > > #endif > > > + if (nr_running > 1) > > > + *sg_status |= SG_OVERLOAD; > > > > Why do you move this code related to overload ? > > This was a cosmetic change to put the NUMA related stats next to the other ones. Please don't add unrelated cosmetic changes in a patch > > [...]