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.2 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 93E0EC4361B for ; Thu, 17 Dec 2020 10:52:11 +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 2613523899 for ; Thu, 17 Dec 2020 10:52:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2613523899 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=g63fIBEwH5O0kEE4ZPXmpiLknHENXOCCZ7jHkNN12q4=; b=MDE8IikujmGYkLXAwuTrYDMLa gXR4EjmabFURiFUWzyCzeYG9C3+iR8eLsN8BrAkWqA7pwx2k9SN8T3I7rkRzoxpRwYGyMyeYnVtgw 9bnBwp3Iu78t1IrCKFkumWWzAwBI/eUFZQGfPE7O0K3LG51i5guEM44IxKxa//1FOnjzfFvgEf4kx NCYVbldp/Zof0+jxz7PIKZi+655QAwM2xNLzl+z4GzG6QkQt29oaBFzoulNMJOxyyAjE7C+UrDh/l ai6IdW1ZEzCPp4ip6SSVVeR213UQGS+6RPhqd5R55ymFkwbyyayZCfQhIUB87beNaCO2OV/pHWObL WirnUifOA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpqs6-000456-HZ; Thu, 17 Dec 2020 10:50:58 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpqs3-00043r-Tf for linux-arm-kernel@lists.infradead.org; Thu, 17 Dec 2020 10:50:56 +0000 Received: by mail-pg1-x536.google.com with SMTP id c22so4628093pgg.13 for ; Thu, 17 Dec 2020 02:50:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qhek/ZoXr5kvoklgOpzW0vQKDjV39nf+N7ITPqoLerA=; b=WS89X/8FFmpCi5bwBCSX9QFDkSmgpIqTzO34KCS1AP8+WG0FM5JJ7oxFvd82olqQXu 4X58anbQaijN2t+X+RLeynAQrUsiS0MEiotfzfp14Iz7OenR6phxoI4y6hqNhEVB+Cqh tpRyYckBMp4lWdpFJRMdIsaWH18i/z+w0J5NLAMQ+7gm1xe9VGQPNIEG57gLWcy2x6mz nbt4qHfp9Nf34kqrgbWPK1xIxaq959Q3iIhBAXgprhnR7VjOLm6afUq8PyOgTeMQLHr0 25a44xe8bR6SS2RRUOXHx5aiUyyo2kZBTiOn5xlrhz2C3FtjMw0RhmaW722yAd+CEyoy ZwOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qhek/ZoXr5kvoklgOpzW0vQKDjV39nf+N7ITPqoLerA=; b=YHlWyjYmST4Ik4vqZqtBPTWDfQ58P9cAnNdKbekSdkxYbm+zx0T+04Qk4Il3QPley7 BsJKPfN+2OiglFdvan2ztdr5FaBq/z4qmYjAQTw8NWUSY9DbISrY7usnNb5ATgHXmYOg PwZr6piaIWNNbHJlpRWWYPrPa4h0h2NAsYL2dIY0Rv0QzUpIzvpUWJTtuTnDTfV3sVMD 1hNJiagoqdj40OXYXMAG8ThFmhwYmS6BuFJsUALiwPoRRAImQYmThDvilI+rFUeLLy+f lYPGjW4QCfxtElZlcSLW/3ZlE5sUVOzrkRp3Pva+oRivbbM+THSGFoi4ta7nOvAKyfrd 37Ig== X-Gm-Message-State: AOAM533T3iq1lrp137wT5wEsGLAlCoWRyAE2pKsbETAGSExo+scOWr9c rghwUbf+s28VKPtXf13gFB+RgQ== X-Google-Smtp-Source: ABdhPJzvvlJ7sLr17pfkVjIYEg4FrUdZcBcrQruW8+GjQ2aJwlJLm8UPgkV/9DySu+mUNt+K3a0UJA== X-Received: by 2002:a62:8895:0:b029:19e:92ec:6886 with SMTP id l143-20020a6288950000b029019e92ec6886mr25683245pfd.12.1608202253313; Thu, 17 Dec 2020 02:50:53 -0800 (PST) Received: from localhost ([122.172.20.109]) by smtp.gmail.com with ESMTPSA id e6sm4666385pjr.34.2020.12.17.02.50.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Dec 2020 02:50:51 -0800 (PST) Date: Thu, 17 Dec 2020 16:20:49 +0530 From: Viresh Kumar To: Ionela Voinescu Subject: Re: [PATCH V3 3/3] arm64: topology: Make AMUs work with modular cpufreq drivers Message-ID: <20201217105049.z3aqhl4mo56hhqvk@vireshk-i7> 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201216193724.GA375@arm.com> User-Agent: NeoMutt/20180716-391-311a52 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201217_055056_087037_3F82169B X-CRM114-Status: GOOD ( 25.74 ) 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 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(). > > [..] > > > > + ret = cpufreq_register_notifier(&init_amu_fie_notifier, > > > > + CPUFREQ_POLICY_NOTIFIER); > > The above makes the use of AMUs for FIE tightly coupled with cpufreq. > > Initially I made cpufreq_get_hw_max_freq(cpu) a weak function for the > possible platforms that might not use a cpufreq driver and might want to > provide this function to still benefit from the use of counters for > frequency invariance. > > But I'm starting to believe that supporting all these corner-cases in > advance just introduces messiness. > > So feel free to remove the 'weak' state of cpufreq_get_hw_max_freq() as > well, so we don't keep wondering why we had that in the first place. > It would not make any sense keeping that in light of these changes. Will do it in a separate patch then. > P.S. I will be on holiday starting tomorrow until beginning of January. > Were you intending this for 5.11, or can I take more time to review > future versions and continue testing? I wanted to :) -- viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel