Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp831112rwd; Wed, 7 Jun 2023 07:28:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5nJJde/3uGFdOWlesCe5fizNiqG+XXX2E+QPopxOHxD5fXmXDDJeRXYsZRUt6zX0yFqiWv X-Received: by 2002:a17:902:c202:b0:1b1:bcea:c8f7 with SMTP id 2-20020a170902c20200b001b1bceac8f7mr14735543pll.15.1686148092628; Wed, 07 Jun 2023 07:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686148092; cv=none; d=google.com; s=arc-20160816; b=WP2540lUkLnJzQ/vN58MyOZ6wSzc64wIw/wTDV5rEbZQt3tF6bqGHStn/WJQKguuKF Izz9vxa0sU0zh57ytjXoqSrlPjApC9MN5LLq8bT53X0DiA2XsAxmo4EPuxpTG6VpdVkC fh1w1nxWS1pR+8Yiu8kTKHm4Exyq/+5f8OWajsGWCwHJ5BB2OLDQZcOjOsDaaLIEU+Bw ZMGb/ERFDlozTqufhoBqWb/zsJXCxwB2L7ebM3ccz0smCiGmIMpVO1y0wjy9nSu5dTcV a+QvBrMO6MXR9PfHUFU7e9R0mKp+rYkJ+jgGCQVO77n5edafb+vyHB3OaQHKptPBqeal 7Fog== 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=BGYx3XtquHh1ZGXlz+RZ++W5y2GRfen/enb4TTPCp2k=; b=YjIDQWYhbNL5YK+FBh/qOlF0P77mJj47uYRXDN/YGDsUKGjDIvZxfA1jdrK194Y3hz rlBiRScU7w4cFpzPyfsWNdzu7WuqDpJEl2M7THM1ybhFA1zAWxmSFONfhmnt6Gg72LUr C6kW5SUIt5pJj7pPhdhdAykAHF9FL9ULuOfI306MbDcC/iiAkuBsAuwhkr8D2inKaZhk 2ZbEuZyb9Qwu3B43tEMVbZ9QBWfGFjouU3qW0gIOcCYb/l7jpuBRxAhGuDfGAxjIoy0c 0WffcrH9/tM34lgGaWSllYTaaAoe0WrclHculaXRBV+UCYA7oFSAZwL6jPqKmNy3k01c LVhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x17-20020a63f711000000b005346c49e06fsi8689591pgh.845.2023.06.07.07.27.56; Wed, 07 Jun 2023 07:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239651AbjFGOA7 (ORCPT + 99 others); Wed, 7 Jun 2023 10:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235372AbjFGOA5 (ORCPT ); Wed, 7 Jun 2023 10:00:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AE4E1BD9; Wed, 7 Jun 2023 07:00:56 -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 198C9AB6; Wed, 7 Jun 2023 07:01:41 -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 DDD9B3F587; Wed, 7 Jun 2023 07:00:52 -0700 (PDT) Date: Wed, 7 Jun 2023 15:00:49 +0100 From: Beata Michalska To: Sudeep Holla 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, viresh.kumar@linaro.org, ionela.voinescu@arm.com, sumitg@nvidia.com, yang@os.amperecomputing.com 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> <20230607095856.7nyv7vzuehceudnl@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230607095856.7nyv7vzuehceudnl@bogus> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Wed, Jun 07, 2023 at 10:58:56AM +0100, Sudeep Holla wrote: > On Tue, Jun 06, 2023 at 04:57:54PM +0100, Beata Michalska wrote: > > With the Frequency Invariance Engine (FIE) being already wired up with > > sched tick and making use of relevant (core counter and constant > > counter) AMU counters, getting the current frequency for a given CPU > > on supported platforms, can be achieved by utilizing the frequency scale > > factor which reflects an average CPU frequency for the last tick period > > length. > > > > With that at hand, arch_freq_get_on_cpu dedicated implementation > > gets enrolled into cpuinfo_cur_freq policy sysfs attribute handler, > > which is expected to represent the current frequency of a given CPU, > > as obtained by the hardware. This is exactly the type of feedback that > > cycle counters provide. > > > > In order to avoid calling arch_freq_get_on_cpu from the scaling_cur_freq > > attribute handler for platforms that do provide cpuinfo_cur_freq, and > > yet keeping things intact for those platform that do not, its use gets > > conditioned on the presence of cpufreq_driver (*get) callback (which also > > seems to be the case for creating cpuinfo_cur_freq attribute). > > > > LGTM, > > Reviewed-by: Sudeep Holla > Thanks for the review. > However I fail to understand if both the changes are dependent ? > Can this be split into 2 patches ? I fail to see the dependency, what > am I missing ? Even if there is some dependency to get arch value > (arch_freq_get_on_cpu() from show_cpuinfo_cur_freq()), you can push > that change first followed by the arm64 change as 2 different change. > I guess I could split the patch into two parts: 1. adding implementation for the arch_freq_get_on_cpu 2. wiring it up with the cpufreq relevant attrib handlers or the other way round (if that's what you have in mind). Will wait a bit for any further comments before pushing new v. --- BR B. > -- > Regards, > Sudeep