Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2305758rdb; Thu, 21 Sep 2023 14:54:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwwrP4moCEYWyOHxBjX/xjrbCf4U5iQ/fqkN+CEKr87mgmGflgXELfVp+VzvCHi3PvgZvM X-Received: by 2002:a05:6a20:4293:b0:125:3445:8af0 with SMTP id o19-20020a056a20429300b0012534458af0mr1247862pzj.7.1695333260540; Thu, 21 Sep 2023 14:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695333260; cv=none; d=google.com; s=arc-20160816; b=oTZ6XwgnxCeXGSpm8UuJ6hkU+tJ2q0CAYk8pmN8xZ16S9Qw8hXVD8ZPkl3ptowNhC4 Q0x0P86yH5yLejE4obbGYlfpLkVJkw6YJvZsNMGTnYwOBbk2/vMJpZZjJMEk9++o1x5Z crQhdgK6LTx3xhspMaYOpnUxbHIMB7uFZGvLj3iYGj/43BrMWUiUNdRDsofaPi2Osl03 9w5iUs8aaVTejx3qjX2IVWt2rb0KV1FALXNsz2bLpBT00Swy5fZVqiyGoQmPUdhwzMy+ cOGMJyXiDA272ix10jp/pjoQiMzSaAeOtY5rPcG9P0Og+F3xZ2RUWBeNXawXniD4xNxG 6AZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=eH2SD2LymlTXKtBUPqG/+o6vd1JGUCA9LhXmwN2xU3E=; fh=Eaes4/AQ8q/AA0BEhCMi5bvlbgcgow9oe1P89a/PyhA=; b=AhQiWSmuhd5JB66RELsP3IJrX85lVBjkPIFyY2UuE388awQdm9Mr+myEKhOO5cE3TC KtJ+akPbJWlgKau6PWn3nn8ly2j/MujiaOr+jI+pro5TM3NLf7QMgyiZxoDPrag3i8ye 6cFi4cIqzGSwNu82A/xqWqGFBgwKcr/vR5TQlH3Y9pWNZNQULqhhYZeCtbU3YveifXWL ziyyiMZKgBbOPFtGB7C4M9UC/AiXELwMXErix7+hKzIDV54/LwhEOPNzmOt2id8h+MUA YtcZgGMGAOx2VLh5OyWwlGwGjDSN3lDXabQPR/M11oJz6Oyg60ymm2BT1K2wHpJ5SCrs Jlxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g20-20020a056a001a1400b0068fcf6fe22esi2458215pfv.306.2023.09.21.14.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 14:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 71B8B8327FBA; Thu, 21 Sep 2023 14:12:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232424AbjIUVMe (ORCPT + 99 others); Thu, 21 Sep 2023 17:12:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjIUVLD (ORCPT ); Thu, 21 Sep 2023 17:11:03 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35E3DA0C3C; Thu, 21 Sep 2023 10:57:37 -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 B63E61595; Thu, 21 Sep 2023 03:12:48 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.2.78.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 366B93F59C; Thu, 21 Sep 2023 03:12:11 -0700 (PDT) Date: Thu, 21 Sep 2023 11:12:09 +0100 From: Ionela Voinescu To: Vincent Guittot Cc: linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pm@vger.kernel.org, conor.dooley@microchip.com, suagrfillet@gmail.com, ajones@ventanamicro.com, lftan@kernel.org Subject: Re: [PATCH 0/4] consolidate and cleanup CPU capacity Message-ID: References: <20230901130312.247719-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230901130312.247719-1-vincent.guittot@linaro.org> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:12:36 -0700 (PDT) On Friday 01 Sep 2023 at 15:03:08 (+0200), Vincent Guittot wrote: > This is the 1st part of consolidating how the max compute capacity is > used in the scheduler and how we calculate the frequency for a level of > utilization. > > Fix some unconsistancy when computing frequency for an utilization. There > can be a mismatch between energy model and schedutil. There are a few more pieces of functionality that would be worth consolidating in this set as well, if you'd like to consider them: - arch_set_freq_scale() still uses policy->cpuinfo.max_freq. It might be good to use the boot time stored max_freq here as well. Given that arch_scale_cpu_capacity() would be based on that stored value, if arch_scale_freq_capacity() ends up using a different value, it could have interesting effects on the utilization signals in case of boosting. - As Pierre mentioned in a previous comment, there is already a cpufreq_get_hw_max_freq() weak function that returns policy->cpuinfo.max_freq and it's only used at boot time by the setup code for AMU use for frequency invariance. I'm tempted to suggest to use this to initialize what is now "freq_factor" as my intention when I created that function was to provide platform providers with the possibility to implement their own and decide on the frequency they choose as their maximum. This could have been an arch_ function as well, but as you mentioned before, mobile and server platforms might want to choose different maximum values even if they are using the same architecture. Thanks, Ionela. > > Next step will be to make a difference between the original > max compute capacity of a CPU and what is currently available when > there is a capping applying forever (i.e. seconds or more). > > Vincent Guittot (4): > sched: consolidate and cleanup access to CPU's max compute capacity > topology: add a new arch_scale_freq_reference > cpufreq/schedutil: use a fixed reference frequency > energy_model: use a fixed reference frequency > > arch/arm/include/asm/topology.h | 1 + > arch/arm64/include/asm/topology.h | 1 + > arch/riscv/include/asm/topology.h | 1 + > drivers/base/arch_topology.c | 9 +++------ > include/linux/arch_topology.h | 7 +++++++ > include/linux/energy_model.h | 20 +++++++++++++++++--- > kernel/sched/core.c | 2 +- > kernel/sched/cpudeadline.c | 2 +- > kernel/sched/cpufreq_schedutil.c | 29 +++++++++++++++++++++++++++-- > kernel/sched/deadline.c | 4 ++-- > kernel/sched/fair.c | 18 ++++++++---------- > kernel/sched/rt.c | 2 +- > kernel/sched/sched.h | 6 ------ > kernel/sched/topology.c | 7 +++++-- > 14 files changed, 75 insertions(+), 34 deletions(-) > > -- > 2.34.1 > >