public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Chen Yu <yu.c.chen@intel.com>,
	Timo Valtoaho <timo.valtoaho@gmail.com>
Subject: Re: [PATCH] cpufreq: governor: Fix handling of special cases in dbs_update()
Date: Fri, 6 May 2016 12:00:56 +0530	[thread overview]
Message-ID: <20160506063056.GC24109@vireshk-i7> (raw)
In-Reply-To: <4149261.sebfWj8seH@vostro.rjw.lan>

On 06-05-16, 01:30, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> As reported in KBZ 69821:
> 
> "With CONFIG_HZ_PERIODIC=y cpu stays at the lowest frequcency 800MHz
>  even if usage goes to 100%, frequency does not scale up, the governor
>  in use is ondemand. Neither works conservative. Performance and
>  userspace governors work as expected.
> 
>  With CONFIG_NO_HZ_IDLE or CONFIG_NO_HZ_FULL cpu scales up with ondemand
>  as expected."
> 
> Analysis carried out by Chen Yu leads to the conclusion that the
> observed issue is due to idle_time in dbs_update() representing a
> negative number in which case the function will return 0 as the load
> (unless load is greater than 0 for another CPU sharing the policy),
> although that need not be the right choice.
> 
> Indeed, idle_time representing a negative number means that during
> the last sampling interval the CPU was almost 100% busy on the rough
> average, so 100 should be returned as the load in that case.
> 
> Modify the code accordingly and rearrange it to clarify the handling
> of all of the special cases in it.  While at it, also avoid returning
> zero as the load if time_elapsed is 0 (it doesn't really make sense
> to return 0 then).
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=69821
> Tested-by: Chen Yu <yu.c.chen@intel.com>
> Tested-by: Timo Valtoaho <timo.valtoaho@gmail.com>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  drivers/cpufreq/cpufreq_governor.c |   87 +++++++++++++++++++++----------------
>  1 file changed, 51 insertions(+), 36 deletions(-)

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

-- 
viresh

      reply	other threads:[~2016-05-06  6:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-05 23:30 [PATCH] cpufreq: governor: Fix handling of special cases in dbs_update() Rafael J. Wysocki
2016-05-06  6:30 ` Viresh Kumar [this message]

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=20160506063056.GC24109@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=timo.valtoaho@gmail.com \
    --cc=yu.c.chen@intel.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