LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-pm@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	claudio@evidence.eu.com, patrick.bellasi@arm.com,
	juri.lelli@redhat.com, joelaf@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: schedutil: Avoid using invalid next_freq
Date: Wed, 9 May 2018 15:16:20 +0530	[thread overview]
Message-ID: <20180509094620.zblddmbxe6vxsc5h@vireshk-i7> (raw)
In-Reply-To: <2276196.ev9rMjHTR0@aspire.rjw.lan>

On 09-05-18, 11:44, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> If the next_freq field of struct sugov_policy is set to UINT_MAX,
> it shouldn't be used for updating the CPU frequency (this is a
> special "invalid" value), but after commit b7eaf1aab9f8 (cpufreq:
> schedutil: Avoid reducing frequency of busy CPUs prematurely) it
> may be passed as the new frequency to sugov_update_commit() in
> sugov_update_single().
> 
> Fix that by adding an extra check for the special UINT_MAX value
> of next_freq to sugov_update_single().
> 
> Fixes: b7eaf1aab9f8 (cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely)
> Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: 4.12+ <stable@vger.kernel.org> # 4.12+
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  kernel/sched/cpufreq_schedutil.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: linux-pm/kernel/sched/cpufreq_schedutil.c
> ===================================================================
> --- linux-pm.orig/kernel/sched/cpufreq_schedutil.c
> +++ linux-pm/kernel/sched/cpufreq_schedutil.c
> @@ -305,7 +305,8 @@ static void sugov_update_single(struct u
>  	 * Do not reduce the frequency if the CPU has not been idle
>  	 * recently, as the reduction is likely to be premature then.
>  	 */
> -	if (busy && next_f < sg_policy->next_freq) {
> +	if (busy && next_f < sg_policy->next_freq &&
> +	    sg_policy->next_freq != UINT_MAX) {
>  		next_f = sg_policy->next_freq;
>  
>  		/* Reset cached freq as next_freq has changed */

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

  reply	other threads:[~2018-05-09  9:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08  6:42 [PATCH] sched/schedutil: Don't set next_freq to UINT_MAX Viresh Kumar
2018-05-08 20:54 ` Rafael J. Wysocki
2018-05-09  8:41   ` Viresh Kumar
2018-05-09  8:56     ` Rafael J. Wysocki
2018-05-09  9:15       ` Viresh Kumar
2018-05-09  9:23         ` Rafael J. Wysocki
2018-05-09  9:30           ` Viresh Kumar
2018-05-09  9:32             ` Rafael J. Wysocki
2018-05-09  9:44 ` [PATCH] cpufreq: schedutil: Avoid using invalid next_freq Rafael J. Wysocki
2018-05-09  9:46   ` Viresh Kumar [this message]
2018-05-09 10:35   ` [PATCH V2] sched/schedutil: Don't set next_freq to UINT_MAX Viresh Kumar
2018-05-11 20:47     ` [V2] " Joel Fernandes
2018-05-17 10:33       ` Rafael J. Wysocki

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=20180509094620.zblddmbxe6vxsc5h@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=claudio@evidence.eu.com \
    --cc=joelaf@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    --subject='Re: [PATCH] cpufreq: schedutil: Avoid using invalid next_freq' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).