Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1280828pxb; Thu, 28 Oct 2021 00:19:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywOfdO9g+NPJeHqgfzhbEkWHZ6wt7LIk/acysL06IDmxegyJPK3nOLtQFkvadMLD81Gl8M X-Received: by 2002:a17:906:4f12:: with SMTP id t18mr734165eju.556.1635405575145; Thu, 28 Oct 2021 00:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635405575; cv=none; d=google.com; s=arc-20160816; b=mJVziyaWscj6AEvv8VQW2vnOsLB3QEqzsUyr9dNh4E9Tp84HASgGqOsqU6iRf2ZcMy 5+l8nPfuWmkLC5dwEAfrlmWNrr3lJ1aCQ2GaXOXutinZouC81k8I4HsH7eURjUHKvb7k OTkE3BroPXg13u1R/C2c+T3jTA5LdXtW19X7ya+sGwnzW3boZD/9+wUViJFLInUH/l0y 732QYU96gkIt4QH54QNhtd+qt7tjIjM5xpMWZlq0vmSBo3J0N9fM0pECUBpbvBqGbUN2 JNpQAJJNqTtObxLvydJRl8ZSfBfZJDMx3MJD26bpF9/jsS5fGuLSwBF8zgy9qygr3FTm On8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=q0ka/EbUAOrxy+zXi2iBwkYQJAOF7T2Zmmb7PKxhDAA=; b=D6160PyYmnPzRq9px2mWLePqfyasQFzJ8NuS9Reo5l0Co9vGrKVjPDQqD12KDm163l iE2H7iDb8FSJ1Q5JORpmkJFGhWL2Li87JYficJPALrqlX7683uqSjhqnKGoUTxqfFNjG nVslTLSvLXK3pWSYpg9WEm4DcK74dU7cf9QYaJ/WGJR0L/MmHyAxJ9/Vx7wrduRPpyUi 58UKC6Sl2g3aDTh1d08HhdVxGTd/G1nWr43Jm6iF4OIWkd/vISrKqtRr7YCEbxoccDI6 etxBsg3vdL2zTku548KCxW0u8YZYjYyqWtJvZPQzTLCfwNo9Xkxubp5CDpNBjcr+tZRP Xk6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk36si3116234ejc.652.2021.10.28.00.19.11; Thu, 28 Oct 2021 00:19:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229835AbhJ1HTU (ORCPT + 99 others); Thu, 28 Oct 2021 03:19:20 -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