public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Luba <lukasz.luba@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Xuewen Yan <xuewen.yan@unisoc.com>,
	rui.zhang@intel.com, rafael@kernel.org, linux-pm@vger.kernel.org,
	amit.kachhap@gmail.com, daniel.lezcano@kernel.org,
	linux-kernel@vger.kernel.org, ke.wang@unisoc.com,
	di.shen@unisoc.com, jeson.gao@unisoc.com, xuewen.yan94@gmail.com
Subject: Re: [RFC PATCH 1/2] thermal/cpufreq_cooling: remove unused cpu_idx in get_load()
Date: Mon, 23 Mar 2026 10:52:32 +0000	[thread overview]
Message-ID: <c19fc390-ca3e-4ad9-92e8-e30dfd6fc95b@arm.com> (raw)
In-Reply-To: <sbtbzkzrtgrmqhxnwcqrvxprgzytkzwcsanooyukhphymgt4t6@telvhz3yolx3>



On 3/23/26 10:41, Viresh Kumar wrote:
> On 23-03-26, 09:20, Lukasz Luba wrote:
>> Thanks for monitoring the development (it's always good
>> to have extra engineer opinion)!
>>
>> I've checked the commit that you referred to and the 'i++' there.
>> It's safe. That commit removed the heavy operation for only
>> tracing purpose, namely:
>> - allocate buffer for N CPUs for 'load_cpu' pointer
>> - populate CPUs' load from the idle fwk
>> - put that info into the trace
>> - free the 'load_cpu' buffer
>>
>> That has been redesigned since it was just for tracing
>> and introducing extra time spent for code run in the
>> throttling phase.
>>
>> The code in get_load() is OK with the commit that you
>> mentioned.
> 
> The code
> 
>          load = get_load(cpufreq_cdev, cpu, i);
> 
> depends on `i` being incremented in the loop to get the correct
> `cpu_idx`. But the said commit removed it and left `i` to be set to 0
> for ever.
> 
> How is that okay ? What am I missing ?
> 

Right, there is a mix of two things.
The 'i' left but should be removed as well, since
this is !SMP code with only 1 cpu and i=0.

The whole split which has been made for getting
the load or utilization from CPU(s) needs to be
cleaned. The compiled code looks different since
it knows there is non-SMP config used.

Do you want to clean that or I should do this?

  reply	other threads:[~2026-03-23 10:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 11:31 [RFC PATCH 1/2] thermal/cpufreq_cooling: remove unused cpu_idx in get_load() Xuewen Yan
2026-03-20 11:31 ` [RFC PATCH 2/2] thermal/cpufreq_cooling: Use idle_time to get cpu_load when scx_enabled Xuewen Yan
2026-03-24  1:41   ` Qais Yousef
2026-03-20 12:32 ` [RFC PATCH 1/2] thermal/cpufreq_cooling: remove unused cpu_idx in get_load() Lukasz Luba
2026-03-21  8:48   ` Xuewen Yan
2026-03-23  5:34   ` Viresh Kumar
2026-03-23  9:20     ` Lukasz Luba
2026-03-23 10:41       ` Viresh Kumar
2026-03-23 10:52         ` Lukasz Luba [this message]
2026-03-23 11:06           ` Viresh Kumar
2026-03-23 13:25             ` Lukasz Luba
2026-03-24  2:20               ` Xuewen Yan
2026-03-24 10:46                 ` Lukasz Luba
2026-03-24 12:03                   ` Xuewen Yan
2026-03-25  8:31                     ` Lukasz Luba
2026-03-26  9:05                   ` Qais Yousef
2026-03-26  9:21                     ` Lukasz Luba
2026-03-28  8:09                       ` Qais Yousef

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c19fc390-ca3e-4ad9-92e8-e30dfd6fc95b@arm.com \
    --to=lukasz.luba@arm.com \
    --cc=amit.kachhap@gmail.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=di.shen@unisoc.com \
    --cc=jeson.gao@unisoc.com \
    --cc=ke.wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=xuewen.yan94@gmail.com \
    --cc=xuewen.yan@unisoc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox