public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	viresh.kumar@linaro.org, peterz@infradead.org,
	vincent.guittot@linaro.org
Subject: Re: [PATCH] sched/cpufreq_schedutil: use now as reference when aggregating shared policy requests
Date: Thu, 4 May 2017 15:40:42 +0100	[thread overview]
Message-ID: <20170504144042.GC13739@e106622-lin> (raw)
In-Reply-To: <1597987.Ujfy2HKTBn@aspire.rjw.lan>

Hi Rafael,

On 04/05/17 16:29, Rafael J. Wysocki wrote:
> On Wednesday, May 03, 2017 02:30:48 PM Juri Lelli wrote:
> > Currently, sugov_next_freq_shared() uses last_freq_update_time as a
> > reference to decide when to start considering CPU contributions as
> > stale.
> > 
> > However, since last_freq_update_time is set by the last CPU that issued
> > a frequency transition, this might cause problems in certain cases. In
> > practice, the detection of stale utilization values fails whenever the
> > CPU with such values was the last to update the policy. For example (and
> > please note again that the SCHED_CPUFREQ_RT flag is not the problem
> > here, but only the detection of after how much time that flag has to be
> > considered stale), suppose a policy with 2 CPUs:
> > 
> >                CPU0                |               CPU1
> >                                    |
> >                                    |     RT task scheduled
> >                                    |     SCHED_CPUFREQ_RT is set
> >                                    |     CPU1->last_update = now
> >                                    |     freq transition to max
> >                                    |     last_freq_update_time = now
> >                                    |
> > 
> >                         more than TICK_NSEC nsecs
> > 
> >                                    |
> >      a small CFS wakes up          |
> >      CPU0->last_update = now1      |
> >      delta_ns(CPU0) < TICK_NSEC*   |
> >      CPU0's util is considered     |
> >      delta_ns(CPU1) =              |
> >       last_freq_update_time -      |
> >       CPU1->last_update = 0        |
> >       < TICK_NSEC                  |
> >      CPU1 is still considered      |
> >      CPU1->SCHED_CPUFREQ_RT is set |
> >      we stay at max (until CPU1    |
> >      exits from idle)              |
> > 
> > * delta_ns is actually negative as now1 > last_freq_update_time
> > 
> > While last_freq_update_time is a sensible reference for rate limiting,
> > it doesn't seem to be useful for working around stale CPU states.
> > 
> > Fix the problem by always considering now (time) as the reference for
> > deciding when CPUs have stale contributions.
> > 
> > Signed-off-by: Juri Lelli <juri.lelli@arm.com>
> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> 
> OK
> 
> I'll queue this up if there are no objections from the people in the CC.
> 

Thanks!

Best,

- Juri

  reply	other threads:[~2017-05-04 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 13:30 [PATCH] sched/cpufreq_schedutil: use now as reference when aggregating shared policy requests Juri Lelli
2017-05-04 14:29 ` Rafael J. Wysocki
2017-05-04 14:40   ` Juri Lelli [this message]
2017-05-04 14:41 ` Vincent Guittot
2017-05-05  6:06 ` 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=20170504144042.GC13739@e106622-lin \
    --to=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=vincent.guittot@linaro.org \
    --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