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 X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE241C433E1 for ; Thu, 30 Jul 2020 11:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BC6820838 for ; Thu, 30 Jul 2020 11:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727856AbgG3Lox (ORCPT ); Thu, 30 Jul 2020 07:44:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:51340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgG3Lox (ORCPT ); Thu, 30 Jul 2020 07:44:53 -0400 Received: from gaia (unknown [95.146.230.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FDAD2082E; Thu, 30 Jul 2020 11:44:50 +0000 (UTC) Date: Thu, 30 Jul 2020 12:44:48 +0100 From: Catalin Marinas To: Ionela Voinescu Cc: rjw@rjwysocki.net, viresh.kumar@linaro.org, dietmar.eggemann@arm.com, sudeep.holla@arm.com, will@kernel.org, linux@armlinux.org.uk, mingo@redhat.com, peterz@infradead.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Valentin Schneider Subject: Re: [PATCH v2 6/7] arch_topology,arm,arm64: define arch_scale_freq_invariant() Message-ID: <20200730114447.GK25149@gaia> References: <20200722093732.14297-1-ionela.voinescu@arm.com> <20200722093732.14297-7-ionela.voinescu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200722093732.14297-7-ionela.voinescu@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 22, 2020 at 10:37:31AM +0100, Ionela Voinescu wrote: > From: Valentin Schneider > > arch_scale_freq_invariant() is used by schedutil to determine whether > the scheduler's load-tracking signals are frequency invariant. Its > definition is overridable, though by default it is hardcoded to 'true' > if arch_scale_freq_capacity() is defined ('false' otherwise). > > This behaviour is not overridden on arm, arm64 and other users of the > generic arch topology driver, which is somewhat precarious: > arch_scale_freq_capacity() will always be defined, yet not all cpufreq > drivers are guaranteed to drive the frequency invariance scale factor > setting. In other words, the load-tracking signals may very well *not* > be frequency invariant. > > Now that cpufreq can be queried on whether the current driver is driving > the Frequency Invariance (FI) scale setting, the current situation can > be improved. This combines the query of whether cpufreq supports the > setting of the frequency scale factor, with whether all online CPUs are > counter-based FI enabled. > > While cpufreq FI enablement applies at system level, for all CPUs, > counter-based FI support could also be used for only a subset of CPUs to > set the invariance scale factor. Therefore, if cpufreq-based FI support > is present, we consider the system to be invariant. If missing, we > require all online CPUs to be counter-based FI enabled in order for the > full system to be considered invariant. > > If the system ends up not being invariant, a new condition is needed in > the counter initialization code that disables all scale factor setting > based on counters. > > Precedence of counters over cpufreq use is not important here. The > invariant status is only given to the system if all CPUs have at least > one method of setting the frequency scale factor. > > Signed-off-by: Valentin Schneider > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Sudeep Holla Acked-by: Catalin Marinas