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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C39AC4332F for ; Thu, 28 Oct 2021 07:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 822536108F for ; Thu, 28 Oct 2021 07:16:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbhJ1HTV (ORCPT ); Thu, 28 Oct 2021 03:19:21 -0400 Received: from foss.arm.com ([217.140.110.172]:51560 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbhJ1HTT (ORCPT ); Thu, 28 Oct 2021 03:19:19 -0400 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 ED08E1063; Thu, 28 Oct 2021 00:16:52 -0700 (PDT) Received: from [10.57.25.153] (unknown [10.57.25.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3F8A63F73D; Thu, 28 Oct 2021 00:16:49 -0700 (PDT) Subject: Re: [PATCH v2 1/5] arch_topology: Introduce thermal pressure update function To: Bjorn Andersson Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, sudeep.holla@arm.com, will@kernel.org, catalin.marinas@arm.com, linux@armlinux.org.uk, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, amitk@kernel.org, daniel.lezcano@linaro.org, amit.kachhap@gmail.com, thara.gopinath@linaro.org, agross@kernel.org References: <20211015144550.23719-1-lukasz.luba@arm.com> <20211015144550.23719-2-lukasz.luba@arm.com> From: Lukasz Luba Message-ID: Date: Thu, 28 Oct 2021 08:16:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/27/21 7:43 PM, Bjorn Andersson wrote: > On Fri 15 Oct 07:45 PDT 2021, Lukasz Luba wrote: >> diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h > [..] >> +/** >> + * topology_thermal_pressure_update() - Update thermal pressure for CPUs >> + * @cpus : The related CPUs for which capacity has been reduced >> + * @capped_freq : The maximum allowed frequency that CPUs can run at > > I know this matches what I see in e.g. the Qualcomm cpufreq hw driver, > but in what cases will @capped_freq differ from > cpufreq_get_hw_max_freq(cpumask_first(cpus))? The @capped_freq is the maximum allowed frequency value due to thermal reasons, which will always be lower or equal to the value returned by cpufreq_get_hw_max_freq() (effectively: 'policy->cpuinfo.max_freq'). We limit the frequency (and voltage) of CPU to reduce power (and heat) in the passive cooling system. That information is important to us, because scheduler needs to know how fast the CPU can go. It cannot assume that the speed is always 'policy->cpuinfo.max_freq'. Often it's less then that at heavy load or GPU heavy load (the same SoC). Regards, Lukasz