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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 ADEFAC433E0 for ; Fri, 8 Jan 2021 09:46:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F9AB233EA for ; Fri, 8 Jan 2021 09:46:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F9AB233EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ds9aCbfjpgyjh0ZYGlCL0nAn1L230E9WbIa2rT3oRDI=; b=f6s30KX8r41LOLwlLXawOS/HY 6UlrjPcCOVJaEZmYgnKISRYnlfJQkMfIu6t57CvrYyOOqqeZdg/f7vfBnD3SLn47oA32FyPwM1lbm YWP5nWY5O2rtwjzKW53j7tExsGV6mczsFN30TQ0bYQxCw/YeVUf/dF9q2K/oyThghnXtag5UCu8hH aP6nuyZCudg58LJrIRh8I3XhSfFvBIS09IFIxk+fk1WVA47j/Ggf5wKyt+SwrSGm6exL+GTjs6No9 JSPIo8IqfrfdJX0NaPxpzBXBJ1fj7phXYfnPN/0dWKVwClfNILAjUWTJmrVIRAyAJ/zF1VntH46RT 1ZeSjpyRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxoJm-00089l-3t; Fri, 08 Jan 2021 09:44:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxoJj-00088i-43 for linux-arm-kernel@lists.infradead.org; Fri, 08 Jan 2021 09:44:23 +0000 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 CB46A31B; Fri, 8 Jan 2021 01:44:18 -0800 (PST) Received: from localhost (unknown [10.1.198.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D18A3F70D; Fri, 8 Jan 2021 01:44:18 -0800 (PST) Date: Fri, 8 Jan 2021 09:44:17 +0000 From: Ionela Voinescu To: Viresh Kumar Subject: Re: [PATCH V3 3/3] arm64: topology: Make AMUs work with modular cpufreq drivers Message-ID: <20210108094416.GA19952@arm.com> References: <5ffc7b9ed03c6301ac2f710f609282959491b526.1608010334.git.viresh.kumar@linaro.org> <8f0fe23d1c9effed71d5660c939472d43726a61b.1608010334.git.viresh.kumar@linaro.org> <20201216000349.GA5299@arm.com> <20201216043805.bx6laemhfm2eaufv@vireshk-i7> <20201216193724.GA375@arm.com> <20201217105049.z3aqhl4mo56hhqvk@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201217105049.z3aqhl4mo56hhqvk@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210108_044423_215832_4F339834 X-CRM114-Status: GOOD ( 21.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Vincent Guittot Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thursday 17 Dec 2020 at 16:20:49 (+0530), Viresh Kumar wrote: > On 16-12-20, 19:37, Ionela Voinescu wrote: > > I did not yet test this, but reading this comment made me wonder.. > > > > arch_scale_freq_invariant() (or topology_scale_freq_invariant()) is also > > called from schedutil when obtaining the next frequency. > > > > So if we had a system that only partly supports AMUs but had at some > > point a cpufreq driver that provided FIE for the other CPUs, when we > > unregister the driver, the cpufreq_freq_invariance static key is > > disabled. Therefore, none of the conditions for system invariance is > > now accomplished and arch_scale_freq_invariant() will return false. > > This will be broken as utilization is still scaled, but the algorithm > > for computing the next frequency in schedutil will not take this into > > account. > > I think the best and the easiest solution for this is: > > bool arch_freq_counters_available(const struct cpumask *cpus) > { > return amu_freq_invariant(); > } > > But we probably need to rename it to something like arch_is_fie(). > Now that I think of it again (after spending 30 minutes trying to come up with a more clear solution) I realised this is not actually a problem :). The only location that checks the invariance status is schedutil, but what a cpufreq governor does becomes irrelevant if you remove the cpufreq driver. The only potential problem is if one then inmods a cpufreq driver that's not invariant. But I think that might be on "if" too many to consider. What do you think? Thanks, Ionela. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 D93DCC433DB for ; Fri, 8 Jan 2021 09:45:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A900D233EA for ; Fri, 8 Jan 2021 09:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727948AbhAHJpF (ORCPT ); Fri, 8 Jan 2021 04:45:05 -0500 Received: from foss.arm.com ([217.140.110.172]:48056 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727649AbhAHJpE (ORCPT ); Fri, 8 Jan 2021 04:45:04 -0500 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 CB46A31B; Fri, 8 Jan 2021 01:44:18 -0800 (PST) Received: from localhost (unknown [10.1.198.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D18A3F70D; Fri, 8 Jan 2021 01:44:18 -0800 (PST) Date: Fri, 8 Jan 2021 09:44:17 +0000 From: Ionela Voinescu To: Viresh Kumar Cc: Catalin Marinas , Will Deacon , Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 3/3] arm64: topology: Make AMUs work with modular cpufreq drivers Message-ID: <20210108094416.GA19952@arm.com> References: <5ffc7b9ed03c6301ac2f710f609282959491b526.1608010334.git.viresh.kumar@linaro.org> <8f0fe23d1c9effed71d5660c939472d43726a61b.1608010334.git.viresh.kumar@linaro.org> <20201216000349.GA5299@arm.com> <20201216043805.bx6laemhfm2eaufv@vireshk-i7> <20201216193724.GA375@arm.com> <20201217105049.z3aqhl4mo56hhqvk@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217105049.z3aqhl4mo56hhqvk@vireshk-i7> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 17 Dec 2020 at 16:20:49 (+0530), Viresh Kumar wrote: > On 16-12-20, 19:37, Ionela Voinescu wrote: > > I did not yet test this, but reading this comment made me wonder.. > > > > arch_scale_freq_invariant() (or topology_scale_freq_invariant()) is also > > called from schedutil when obtaining the next frequency. > > > > So if we had a system that only partly supports AMUs but had at some > > point a cpufreq driver that provided FIE for the other CPUs, when we > > unregister the driver, the cpufreq_freq_invariance static key is > > disabled. Therefore, none of the conditions for system invariance is > > now accomplished and arch_scale_freq_invariant() will return false. > > This will be broken as utilization is still scaled, but the algorithm > > for computing the next frequency in schedutil will not take this into > > account. > > I think the best and the easiest solution for this is: > > bool arch_freq_counters_available(const struct cpumask *cpus) > { > return amu_freq_invariant(); > } > > But we probably need to rename it to something like arch_is_fie(). > Now that I think of it again (after spending 30 minutes trying to come up with a more clear solution) I realised this is not actually a problem :). The only location that checks the invariance status is schedutil, but what a cpufreq governor does becomes irrelevant if you remove the cpufreq driver. The only potential problem is if one then inmods a cpufreq driver that's not invariant. But I think that might be on "if" too many to consider. What do you think? Thanks, Ionela.