From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A64BFC77B7C for ; Fri, 5 May 2023 18:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233158AbjEESQh (ORCPT ); Fri, 5 May 2023 14:16:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbjEESQf (ORCPT ); Fri, 5 May 2023 14:16:35 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9A13819D5F for ; Fri, 5 May 2023 11:16:34 -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 AE5291FB; Fri, 5 May 2023 11:17:18 -0700 (PDT) Received: from [192.168.178.92] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E63983F67D; Fri, 5 May 2023 11:16:32 -0700 (PDT) Message-ID: <11e07f3a-3576-f408-1891-2dca5ddf343e@arm.com> Date: Fri, 5 May 2023 20:16:31 +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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05/2023 10:22, Vincent Guittot wrote: > On Thu, 4 May 2023 at 19:11, Dietmar Eggemann wrote: >> >> On 03/05/2023 18:08, Vincent Guittot wrote: >>> On Thu, 6 Apr 2023 at 17:50, Dietmar Eggemann wrote: [...] >>>> 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, ...) >> ^^^^^^^^^^^^^^ > yes only to get same max utilization and as a result the same OPP as schedutil > >> 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? > > hmm, I would stay with util_avg for now OK, in this case I'm trying to refactor cpu_util_next() so that cpu_util_cfs() can call it as well. This will allow me to code the runnable boosting only once in cpu_util_next(). Boosting can then be enabled via an additional `int boost` parameter for cpu_util_next() and cpu_util_cfs().