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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1492CEB64D7 for ; Fri, 16 Jun 2023 09:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=jwWdnvdJBlJ0vHd0dHBJ62yDwR0Lm6lG/56gWlvQoTI=; b=CpNEWXjyzpPpsc SstCCzrrsHT/OuAb/4xxDppEvtylamTLyMmJo+eUfIpaSa7KUPAwOIfhg2ACUGNplf+zEr8vR3mjs 6vAWhDoAtKyjKc1yeknPqE3gMtuN3S0XVk5H8Ffs85EO1edI3u/OgTQCxUm7kFWmUdu93EQ6Oq9zd X3nnEdJxNtpjituEii0cdAfenGl5X3HncJyOPNCRmxZt1WJbj1Rg5HcrQhUunpIDg1E1wSwEd8za9 Dc8xbCJ021k2KRR/giAmNn+ng+sz6r0lO/zwIr4ClXW30pJ6aAnnot1nhloh2XT5aMPFIfZdju4N/ LAQ8ZOxfJ+NE5ZHkkrag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA6Cu-00HWgq-2d; Fri, 16 Jun 2023 09:57:28 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qA6Cr-00HWfz-1C for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 09:57:26 +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 1AA7A1FB; Fri, 16 Jun 2023 02:58:06 -0700 (PDT) Received: from e120325.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CDA603F5A1; Fri, 16 Jun 2023 02:57:18 -0700 (PDT) Date: Fri, 16 Jun 2023 10:57:15 +0100 From: Beata Michalska To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, will@kernel.org, rafael@kernel.org, sudeep.holla@arm.com, ionela.voinescu@arm.com, sumitg@nvidia.com, yang@os.amperecomputing.com, Len Brown , vincent.guittot@linaro.org Subject: Re: [PATCH] arm64: Provide an AMU-based version of arch_freq_get_on_cpu Message-ID: References: <20230606155754.245998-1-beata.michalska@arm.com> <20230608051509.h4a6gn572mjgdusv@vireshk-i7> <20230608051816.2ww7ncg65qo7kcuk@vireshk-i7> <20230609043922.eyyqutbwlofqaddz@vireshk-i7> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230609043922.eyyqutbwlofqaddz@vireshk-i7> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_025725_456095_780EC407 X-CRM114-Status: GOOD ( 31.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Fri, Jun 09, 2023 at 10:09:22AM +0530, Viresh Kumar wrote: > On 08-06-23, 15:45, Beata Michalska wrote: > > For those CPUs that are in full dynticks mode , the arch_freq_scale_factor will > > be basically useless (as there will be no regular sched_tick which eventually > > calls topology_scale_freq_tick()), so the code below will look for any other > > available CPU within current policy that could server as the source of the > > counters. If there is none it will fallback to cpufreq driver to provide > > current frequency. > > Understood. > > > There is a little bit of ambiguity around both 'cpuinfo_cur_freq' and > > 'scaling_cur_freq' and how those two are being handled on different platforms. > > If I got things right, the first one is supposed to reflect the frequency as > > obtained from the hardware, > > Yes, this must be accurate, as much as possible. > > > whereas the latter is more of a sw point of view on that, > > Historically, it was more about the last frequency requested by the software. > But that has changed, for example for X86 and now there is no limitation here > which disallows one to report the more accurate one. > That's my observation as well - thank you for clarifying. > > That could work, I guess. But then we would have 'cpuinfo_cur_freq' == > > 'scaling_cur_freq' for platforms that do provide arch_freq_get_on_cpu, > > which might lead to more confusion as per what is the actual difference between > > the two (?) > > The behavior should be same for all platforms. That's my primary concern here. > If getting same freq from both these files is okay for X86, then it should be > for ARM as well. > I agree it would be good to align the behaviour here. I guess we should wait for more input on what we can and cannot do for x86. --- BR B. > If the X86 commit (f8475cef9008) wasn't already merged, I would have suggested > to do this aperf/mperf thing only in cpuinfo_cur_freq() and not > scaling_cur_freq(). > > Maybe we can still revert back if there is no hard dependency here. > > Len / Rafael ? > > The question is if we should make scaling_cur_freq() to always return the last > requested frequency and make cpuinfo_cur_freq() to return the most accurate one, > preferably using aperf/mperf ? > > -- > viresh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel