linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Chen <yu.c.chen@intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-kernel@vger.kernel.org,
	Artem S Tashkinov <t.artem@mailcity.com>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH][RFC] sched: cpufreq: Fix long idle judgement logic in load calculation
Date: Thu, 7 Jun 2018 23:40:52 +0800	[thread overview]
Message-ID: <20180607154051.GA19168@sandybridge-desktop> (raw)
In-Reply-To: <20180607044543.d7pswad5tshw26lc@vireshk-i7>

Hi Viresh,
thanks for the comment,
On Thu, Jun 07, 2018 at 10:15:43AM +0530, Viresh Kumar wrote:
> On 07-06-18, 11:17, Chen Yu wrote:
> > diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> > index 871bf9c..9792c80 100644
> > --- a/drivers/cpufreq/cpufreq_governor.c
> > +++ b/drivers/cpufreq/cpufreq_governor.c
> > @@ -165,7 +165,7 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
> >  			 * calls, so the previous load value can be used then.
> >  			 */
> >  			load = j_cdbs->prev_load;
> > -		} else if (unlikely(time_elapsed > 2 * sampling_rate &&
> > +		} else if (((int)idle_time > 0) && unlikely(idle_time > 2 * sampling_rate &&
> 
> Yes the figures are insane, but if the idle time is around 36 minutes, the
> conversion to int will make a positive value look negative and we will exit the
> conditional block. And if we don't think that we will ever get such insane idle
> times or we don't want to care about them, then what about doing this instead:
> 
> 		} else if ((unlikely((int)idle_time > 2 * sampling_rate &&
> 
> same below.
> 
Yes, this would be more straightforward.

Best,
Yu
> -- 
> viresh

      reply	other threads:[~2018-06-07 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07  3:17 [PATCH][RFC] sched: cpufreq: Fix long idle judgement logic in load calculation Chen Yu
2018-06-07  4:45 ` Viresh Kumar
2018-06-07 15:40   ` Yu Chen [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=20180607154051.GA19168@sandybridge-desktop \
    --to=yu.c.chen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=t.artem@mailcity.com \
    --cc=viresh.kumar@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 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).