Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2208166rwb; Thu, 27 Jul 2023 04:01:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlEx7AwVc2eKMm0NjFUnqpMl5knsIETn1i32xpDoNRVnpm/sEZc2xhIxb/la2n08lkvNyuwo X-Received: by 2002:a17:90a:c291:b0:268:f2e:b480 with SMTP id f17-20020a17090ac29100b002680f2eb480mr2805930pjt.11.1690455672700; Thu, 27 Jul 2023 04:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690455672; cv=none; d=google.com; s=arc-20160816; b=QBzsn931bRbHouGYLIOrkh6ne15dgA2BzujIRU3wQAmowb1RnT/aXceYPlL0z4O5E+ OO17H/nQUqT4MFZJZkTA5+IokBZ9xPjWs5K+yOFsF8Kgx4SFa1uMnU5jKr7aTantKv/G +DTAskpnlUOP54BZlFB/6fppPlUfh8rhrEVJHYpAGG49Dzf/di7XFAiTmijkFrJEq818 5jAxU2n0ITe8ivMxdjIk5FcRKqWwqzJ3lj8FxvJLNfFJAcehEr8Wx8y87GMQu4b4R5Cl EDhOGbwRQfGyP3b2ZJ0uAO4qo0s6ATuCp5PY+wHrhWMUD/sEgpV+SSmDHcPzKyHYTl2K MSVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=R5X/oORje+bAnICiyN8Wsfuzn2BbHOmd5mrKWOntbJ0=; fh=NtTtoklbZGCcSgxT9IlflZh89eTI+48ASocCrAPBwpg=; b=dLI6NjClaPlu4DuPDObC2/P0lyKbHMcppfJpiGHa1fd71YqDp9tlCo+P99OxifkI19 yz0phlNnBjS2eodHzvYozPA0tC1X5sM2DsFkpAP9CY88hxwIRb2MY5Lc7rkUk/qQJCLH ofdHpu/AQZGuNBp8zw8O7CUte1BWSH/A5fahUcdLb2JEhsyUS9ZXrSRn+9CCe1x5HZ2B rk1yLQJt4cpx+uij/935Y1QDOMjMhWXRUUUEcqtOUpnzw/tAQa/AFPa/PcT7vxho1fMs UC9pLdPWMwC7fLjagvW6LJjvHpOPGMFiBtCuA5igQZGIpnSUIAeivdJHwqu9uEzupZEQ e9gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovuRrgBq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u191-20020a6385c8000000b005638355e990si1143620pgd.410.2023.07.27.04.00.59; Thu, 27 Jul 2023 04:01: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovuRrgBq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232924AbjG0J4f (ORCPT + 99 others); Thu, 27 Jul 2023 05:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232981AbjG0J4W (ORCPT ); Thu, 27 Jul 2023 05:56:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D4C9122; Thu, 27 Jul 2023 02:56:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA3E161DE6; Thu, 27 Jul 2023 09:56:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D4A9C433C8; Thu, 27 Jul 2023 09:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690451771; bh=J7ZXQyJs9VwKG49702cEjp5BBaWLGJW95hpeDTHwnW0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ovuRrgBqVfaaWo+AAwh7i+/KJm/+GHfb6IJKGJChshbe239WjFuQlKZOOvI14PUa3 FtWY5zy2T5NNpwmlMC0ILDQRtX8fa621Ei/QimyzHH8lkTRdZ0bI5ioEn/c0pvgVtL jui5siBD6Z2Sqj+wr+CqYSHbBLd23sRVyox9Yua11qZKdm8pXq7OVT+eDaes6rEEB5 ihpjm9VfTdApcBvVtqqGZ1pWLf5QEBqBZYS5uM8pxB5NLvNfennidFGMoP2c4ELZn8 +v4MHOfOH6XG49E9M6z+DqEbcP+Dq/ZFMP+wn+aTzrXXqXPGMLSMJQNENcntNfhjoj Xb9GoZpGa+EoA== Date: Thu, 27 Jul 2023 10:56:05 +0100 From: Will Deacon To: Beata Michalska Cc: Sudeep Holla , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, mark.rutland@arm.com, 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: <20230727095604.GA18721@willie-the-truck> 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: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 03:00:49PM +0100, Beata Michalska wrote: > 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. Are you still planning on a v2? Will