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 1F66CC61DA4 for ; Wed, 22 Feb 2023 20:29:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232377AbjBVU3J (ORCPT ); Wed, 22 Feb 2023 15:29:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbjBVU3H (ORCPT ); Wed, 22 Feb 2023 15:29:07 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 123941B30D for ; Wed, 22 Feb 2023 12:29:06 -0800 (PST) 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 B8713FEC; Wed, 22 Feb 2023 12:29:48 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 982683F703; Wed, 22 Feb 2023 12:29:03 -0800 (PST) Message-ID: <94eeb587-e9c9-1d92-7fd3-edde46fd4dba@arm.com> Date: Wed, 22 Feb 2023 21:28:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC PATCH 0/1] sched/pelt: Change PELT halflife at runtime Content-Language: en-US To: Vincent Guittot Cc: Peter Zijlstra , Qais Yousef , Kajetan Puchalski , Jian-Min Liu , Ingo Molnar , Morten Rasmussen , Vincent Donnefort , Quentin Perret , Patrick Bellasi , Abhijeet Dharmapurikar , Qais Yousef , linux-kernel@vger.kernel.org, Jonathan JMChen References: <20220829055450.1703092-1-dietmar.eggemann@arm.com> <0f82011994be68502fd9833e499749866539c3df.camel@mediatek.com> <20221108194843.i4qckcu7zwqstyis@airbuntu> <424e2c81-987d-f10e-106d-8b4c611768bc@arm.com> <249816c9-c2b5-8016-f9ce-dab7b7d384e4@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 21/02/2023 10:29, Vincent Guittot wrote: > On Mon, 20 Feb 2023 at 14:54, Vincent Guittot > wrote: >> >> On Fri, 17 Feb 2023 at 14:54, Dietmar Eggemann wrote: >>> >>> On 09/02/2023 17:16, Vincent Guittot wrote: >>>> On Tue, 7 Feb 2023 at 11:29, Dietmar Eggemann wrote: >>>>> >>>>> On 09/11/2022 16:49, Peter Zijlstra wrote: >>>>>> On Tue, Nov 08, 2022 at 07:48:43PM +0000, Qais Yousef wrote: >>>>>>> On 11/07/22 14:41, Peter Zijlstra wrote: >>>>>>>> On Thu, Sep 29, 2022 at 03:41:47PM +0100, Kajetan Puchalski wrote: [...] >>> I ran the same test (boosting only for DVFS requests) with: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ * >>> >>> -->8-- >>> >>> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h >>> index dbc56e8b85f9..7a4bf38f2920 100644 >>> --- a/kernel/sched/sched.h >>> +++ b/kernel/sched/sched.h >>> @@ -2946,6 +2946,8 @@ static inline unsigned long cpu_util_cfs(int cpu) >>> READ_ONCE(cfs_rq->avg.util_est.enqueued)); >>> } >>> >>> + util = max(util, READ_ONCE(cfs_rq->avg.runnable_avg)); >>> + > > Another reason why it gives better results could be that > cpu_util_cfs() is not only used for DVFS selection but also to track > the cpu utilization in load balance and EAS so the cpu will be faster > seen as overloaded and tasks will be spread around when there are > contentions. > > Could you try to take cfs_rq->avg.runnable_avg into account only when > selecting frequency ? I actually did exactly this. (* but not shown in the code snippet). I just used the boosting for CPU frequency selection (from sugov_get_util()). I added the the `_freq` suffix in the kernel name to indicate this. > That being said I can see some place in load balance where > cfs_rq->avg.runnable_avg could give some benefits like in > find_busiest_queue() where it could be better to take into account the > contention when selecting the busiest queue Could be. Looks like so far we only use it in group_has_capacity(), group_is_overloaded() and for NUMA. [...]