mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ananthu C V <ananthu.cv@oss.qualcomm.com>
To: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	Sudeep Holla <sudeep.holla@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Jie Zhan <zhanjie9@hisilicon.com>,
	Pierre Gondois <pierre.gondois@arm.com>,
	linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
	linux-pm@vger.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Oleg Keri <okerixx@gmail.com>
Subject: Re: [PATCH v3 1/2] arch_topology: seed capacity_freq_ref with highest available frequency
Date: Wed, 11 Nov 2026 17:42:49 +0530	[thread overview]
Message-ID: <avRbwew20G2fd0Eo@hu-anancv-blr.qualcomm.com> (raw)
In-Reply-To: <fbd7fe35-5e14-4589-a072-909e49a92e76@oss.qualcomm.com>

Hi Zhongqiu,

On Sun, Oct 11, 2026 at 10:16:37PM +0800, Zhongqiu Han wrote:
> The current implementation looks correct and works well. That said, we
> might be able to optimize it with a simpler implementation as shown
> below:
> 
> +/**
> + * cpufreq_frequency_table_max - Get the highest frequency in a policy's
> table
> + * @policy: the &struct cpufreq_policy to inspect
> + *
> + * Boost entries (%CPUFREQ_BOOST_FREQ) are taken into account regardless of
> + * whether or not boost is currently enabled.
> + *
> + * Return: the highest valid frequency in @policy->freq_table, or 0 if
> there
> + * is no frequency table.
> + */
> +static inline unsigned int
> +cpufreq_frequency_table_max(const struct cpufreq_policy *policy)
> +{
> +	struct cpufreq_frequency_table *pos;
> +	unsigned int max_freq = 0;
> +
> +	if (!policy->freq_table)
> +		return 0;
> +
> +	cpufreq_for_each_valid_entry(pos, policy->freq_table)
> +		max_freq = max(max_freq, pos->frequency);
> +
> +	return max_freq;
> +}
> +
> 
> 
> >   static inline int cpufreq_table_count_valid_entries(const struct cpufreq_policy *policy)
> >   {
> >   	struct cpufreq_frequency_table *pos;

ack, I will try to further simply this with taking in your suggestions, thanks.

> Thx and BRs,
> Zhongqiu Han


Best,
Ananthu

  parent reply	other threads:[~2026-11-11 12:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 11:38 [PATCH v3 0/2] sched/cpufreq: fix schedutil's boost frequency handling Ananthu C V
2026-09-29 11:38 ` [PATCH v3 1/2] arch_topology: seed capacity_freq_ref with highest available frequency Ananthu C V
2026-10-11 14:16   ` Zhongqiu Han
2026-10-12 18:45     ` Dietmar Eggemann
2026-10-13 11:28       ` Zhongqiu Han
2026-11-11 12:10         ` Ananthu C V
2026-11-11 12:12     ` Ananthu C V [this message]
2026-09-29 11:38 ` [PATCH v3 2/2] cpufreq: fix policy max not returning to non-boost freq on boost disable Ananthu C V
2026-10-11 14:17   ` Zhongqiu Han
2026-11-11 12:21     ` Ananthu C V
2026-10-11 23:42   ` Dietmar Eggemann
2026-11-11 12:27     ` Ananthu C V
2026-11-02  8:38   ` Viresh Kumar
2026-11-11 12:40     ` Ananthu C V
2026-09-30  9:10 ` [PATCH v3 0/2] sched/cpufreq: fix schedutil's boost frequency handling Oleg Keri

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=avRbwew20G2fd0Eo@hu-anancv-blr.qualcomm.com \
    --to=ananthu.cv@oss.qualcomm.com \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=okerixx@gmail.com \
    --cc=pierre.gondois@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhongqiu.han@oss.qualcomm.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

all inboxes | Powered by JetHome®