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 DA104C00528 for ; Thu, 27 Jul 2023 09:56:36 +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=xai1+5bZLKIgEhOiKp0uj1ybOEjJFa/HAksqi4MaVms=; b=GSbJrs81YK/gfE uhxKn0ijAuvVrSxpvZxvagEV/7BzP5oOueb9fyFW1/3ua6dD+pjq2dsbj03tSpY9Id46Figf2grv6 L7joOJmgbh6Tx2U/QP16ufwW+Vk9RyOZ314KueaVeYqDTTVyqYKcj16bEkQBu/A+jUtD9Cf9TS5sm PEL9A8zxenlZPypounNsgxEZ4GfLTvhptK+o6P+ziDaXZJPR4PuWPeOZnNZFbY9pCzEsxG35rOZR0 L0msBYxK9sZD5KIyf1cydycutzaH0YBOa3Dj5Ygp/wsg9KZx6PQ78Xl2EYPSk5lcGcE4QfuTqXEau zqp7I/vFu60IlEh/EY4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOxjD-00Ctj6-2W; Thu, 27 Jul 2023 09:56:15 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOxjB-00CtiV-0K for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 09:56:14 +0000 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 E3E0761DE9; 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_025613_356440_6268BC91 X-CRM114-Status: GOOD ( 27.36 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel