Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp848499rwr; Thu, 4 May 2023 10:18:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61LRIZnCu/tZ3HbBCVjydp2pN/MxSLtHqeyBrIcHcyI86no786c6ZH8rU+Kv1AVj8Z0BZf X-Received: by 2002:a17:903:41ca:b0:1ab:c48:1de9 with SMTP id u10-20020a17090341ca00b001ab0c481de9mr5163741ple.65.1683220722214; Thu, 04 May 2023 10:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683220722; cv=none; d=google.com; s=arc-20160816; b=K2/c2IXsreyy2mvHdj+uBl1vt8ozzifzzNMbMRVSfHy6T/pHDgScHyTfp+ddeIgDWo yxchH+OOTXzq0cYN7ZN8WKu+/Nt83r7QykjyykD2hX7aI6oBjs3n5vfNzxNpN6AgYNkD O4NrHTIBX1VX2VEBoGWUPdeLkxcxIZgaBBRmvN8ciuRCGqqlyCQB2KEQoL9Jr1cqCl+0 KSCJ9Md3FD+kUHVWOUVcfE6OFgaA9kqUaV4h3uEhdwkCBAX85ECNFf/d4t0FpG5qB+xp eO3Z47fz0CZiNUvS1aSVHPfMBCextAKY/WVvQcZEgwnQc6tWbg5khho4NwmMGpK46sev oVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=4av9IlWJZLt+rQdXRZEeuB8AGO9VE03QEguQGiBx19I=; b=fzi5V06SDKFprMqf61r7zgaEDyI/4TiyhlpkAUm0tbmlkydlXk6ILMZgs52D63xjXP F853E9UZGm7FO/57a0dEQzYEvIN04MZmsykMOpznoxCriPqmzA0wJtwA7tnWMD1hnoqd 9SPe41HLYlgYd1vQhm10fcF/VX/ZcL9Un9Y9dDjaDKss3QdUG/ESoKZ8VpLK1fV6qAIZ f3XHhM321qvVhTAcwDR1yFV+ScDpxSZzLHfZEljt6udd4N4lBdzmM3TUyig7mgImIAvc r4zLPk+wXs8eWtGE7x3taAz7Qd54yjedz9+IAfNqdGQ3cU8gMIN4iYz5sRDdRknE9Uqa 8UHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a170902bb8600b001ab02f505efsi7638666pls.82.2023.05.04.10.18.27; Thu, 04 May 2023 10:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229818AbjEDRMN (ORCPT + 99 others); Thu, 4 May 2023 13:12:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbjEDRMM (ORCPT ); Thu, 4 May 2023 13:12:12 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EBAC346A3 for ; Thu, 4 May 2023 10:11:38 -0700 (PDT) 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 16FCE1FB; Thu, 4 May 2023 10:12:00 -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 4828D3F64C; Thu, 4 May 2023 10:11:14 -0700 (PDT) Message-ID: Date: Thu, 4 May 2023 19:11:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/1] sched: Consider CPU contention in frequency & load-balance busiest CPU selection Content-Language: en-US To: Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , Qais Yousef , Kajetan Puchalski , Morten Rasmussen , Vincent Donnefort , Quentin Perret , Abhijeet Dharmapurikar , linux-kernel@vger.kernel.org References: <20230406155030.1989554-1-dietmar.eggemann@arm.com> <20230406155030.1989554-2-dietmar.eggemann@arm.com> From: Dietmar Eggemann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2023 18:08, Vincent Guittot wrote: > On Thu, 6 Apr 2023 at 17:50, Dietmar Eggemann wrote: >> >> Use new cpu_boosted_util_cfs() instead of cpu_util_cfs(). >> >> The former returns max(util_avg, runnable_avg) capped by max CPU >> capacity. CPU contention is thereby considered through runnable_avg. >> >> The change in load-balance only affects migration type `migrate_util`. > > would be good to get some figures to show the benefit Yes. Will add JankbenchX on Pixel6 for sugov_get_util() and `perf bench sched messaging` on Ampere Altra with the next version. >> Suggested-by: Vincent Guittot >> Signed-off-by: Dietmar Eggemann >> --- >> kernel/sched/cpufreq_schedutil.c | 3 ++- >> kernel/sched/fair.c | 2 +- >> kernel/sched/sched.h | 19 +++++++++++++++++++ >> 3 files changed, 22 insertions(+), 2 deletions(-) >> >> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c >> index e3211455b203..728b186cd367 100644 >> --- a/kernel/sched/cpufreq_schedutil.c >> +++ b/kernel/sched/cpufreq_schedutil.c >> @@ -158,7 +158,8 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu) >> struct rq *rq = cpu_rq(sg_cpu->cpu); >> >> sg_cpu->bw_dl = cpu_bw_dl(rq); >> - sg_cpu->util = effective_cpu_util(sg_cpu->cpu, cpu_util_cfs(sg_cpu->cpu), >> + sg_cpu->util = effective_cpu_util(sg_cpu->cpu, >> + cpu_boosted_util_cfs(sg_cpu->cpu), > > Shouldn't we have a similar change in feec to estimate correctly which > OPP/ freq will be selected by schedutil ? Yes, this should be more correct. Schedutil and EAS should see the world the same way. But IMHO only for the find_energy_efficient_cpu() compute_energy() eenv_pd_max_util() util = cpu_util_next(..., p, ...) effective_cpu_util(..., util, FREQUENCY_UTIL, ...) ^^^^^^^^^^^^^^ case. Not sure what I do for the task contribution? We use task_util(p)/_task_util_est(p) inside cpu_util_next(). Do I have to consider p->se.avg.runnable_avg as well? I don't think that we have a testcase showing any diff for this change individually though. [...]