All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Vincent Donnefort <vincent.donnefort@arm.com>
Cc: peterz@infradead.org, rjw@rjwysocki.net,
	vincent.guittot@linaro.org, qperret@google.com,
	linux-pm@vger.kernel.org, ionela.voinescu@arm.com,
	lukasz.luba@arm.com, dietmar.eggemann@arm.com, mka@chromium.org
Subject: Re: [PATCH v6 6/7] cpufreq: Skip inefficient frequencies
Date: Wed, 1 Sep 2021 11:00:23 +0530	[thread overview]
Message-ID: <20210901053023.yg4pbmqsgbmvo2qa@vireshk-i7> (raw)
In-Reply-To: <1630405453-275784-7-git-send-email-vincent.donnefort@arm.com>

On 31-08-21, 11:24, Vincent Donnefort wrote:
> +static inline bool

I would drop the inline part here.

> +cpufreq_can_skip_inefficiencies(struct cpufreq_policy *policy)
> +{
> +	struct cpufreq_frequency_table *pos;
> +	bool valid = false;
> +	int idx;
> +
> +	if (!(policy->governor->flags & CPUFREQ_GOV_DYNAMIC_SWITCHING))
> +		return false;
> +
> +	if (policy->freq_table_sorted == CPUFREQ_TABLE_UNSORTED)
> +		return false;
> +
> +	/* Is there at least one inefficiency ? */
> +	cpufreq_for_each_valid_entry(pos, policy->freq_table) {
> +		if (pos->flags & CPUFREQ_INEFFICIENT_FREQ) {
> +			valid = true;
> +			break;
> +		}
> +	}
> +
> +	if (!valid)
> +		return false;
> +
> +	/*
> +	 * Has cpufreq_table_update_efficiencies been called? i.e. is the
> +	 * highest frequency efficient.
> +	 */
> +	cpufreq_for_each_valid_entry_idx(pos, policy->freq_table, idx) {
> +		valid = !!(idx == pos->efficient);

I don't think !! is required here. == already returns a bool.

> +		if (policy->freq_table_sorted ==
> +					CPUFREQ_TABLE_SORTED_DESCENDING)
> +			break;
> +	}

-- 
viresh

  reply	other threads:[~2021-09-01  5:30 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 10:24 [PATCH v6 0/7] Inefficient OPPs Vincent Donnefort
2021-08-31 10:24 ` [PATCH v6 1/7] PM / EM: Fix inefficient states detection Vincent Donnefort
2021-08-31 10:24 ` [PATCH v6 2/7] PM / EM: Mark inefficient states Vincent Donnefort
2021-08-31 10:24 ` [PATCH v6 3/7] PM / EM: Extend em_perf_domain with a flag field Vincent Donnefort
2021-08-31 10:24 ` [PATCH v6 4/7] PM / EM: Allow skipping inefficient states Vincent Donnefort
2021-08-31 10:24 ` [PATCH v6 5/7] cpufreq: Add an interface to mark inefficient frequencies Vincent Donnefort
2021-09-01  4:55   ` Viresh Kumar
2021-09-01 17:25   ` Rafael J. Wysocki
2021-08-31 10:24 ` [PATCH v6 6/7] cpufreq: Skip " Vincent Donnefort
2021-09-01  5:30   ` Viresh Kumar [this message]
2021-09-01 18:13   ` Rafael J. Wysocki
2021-09-02 10:50     ` Vincent Donnefort
2021-09-02 13:09       ` Rafael J. Wysocki
2021-09-02 13:49         ` Vincent Donnefort
2021-09-03 18:14           ` Rafael J. Wysocki
2021-09-06  8:17             ` Vincent Donnefort
2021-09-06 12:08               ` Rafael J. Wysocki
2021-09-06 12:53                 ` Vincent Donnefort
2021-09-06 15:16                   ` Rafael J. Wysocki
2021-09-06 15:32                     ` Rafael J. Wysocki
2021-09-06 15:38                     ` Vincent Donnefort
2021-09-06 16:04                       ` Rafael J. Wysocki
2021-08-31 10:24 ` [PATCH v6 7/7] PM / EM: Mark inefficiencies in CPUFreq Vincent Donnefort
2021-09-01  5:31   ` Viresh Kumar

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=20210901053023.yg4pbmqsgbmvo2qa@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=ionela.voinescu@arm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=mka@chromium.org \
    --cc=peterz@infradead.org \
    --cc=qperret@google.com \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.donnefort@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.