All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V3 2/5] cpufreq: ondemand: update sampling rate immediately
Date: Wed, 28 Oct 2015 15:01:09 +0530	[thread overview]
Message-ID: <20151028093109.GJ30039@ubuntu> (raw)
In-Reply-To: <2498053.EX0k8RstLZ@vostro.rjw.lan>

On 28-10-15, 07:28, Rafael J. Wysocki wrote:
> Your argument seems to be that it should be OK to do the
> cancel_delayed_work_sync()/gov_queue_work() combo in all cases, because
> even if the new rate is greater than the old one, the user may actually
> want it to take effect immediately and it shouldn't hurt to skip the next
> sample anyway in that case.
> 
> Is this really the case, though?  What about the old rate is 1s, the new one
> is 2s and the timer is just about to expire?  Won't the canceling effectively
> move the next sample 3s away from the previous one which may not be desirable?
> 
> The current code just allows the timer to expire, unless that would prevent
> the new rate from taking effect for too long, which seems perfectly reasonable
> to me.

Okay, what about this case: old rate is 1s, new rate it 5s and we have
just serviced the timer. With the current code we will receive
evaluate again after 1 second instead of 5. Is that desirable ?

I didn't wanted to keep special code for such corner cases. And then
how many times are we going to update sampling rates ?

But if we want to do something special, then we may schedule the work
for following delay:

delay = shared->time_stamp + new_sampling_rate.

shared->time_stamp is the last time we evaluated the load.

With this, we will be at shoot at the exact requested time, relative
to the last time we evaluated the loads.

-- 
viresh

  reply	other threads:[~2015-10-28  9:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13  8:09 [PATCH V3 0/5] CPUFreq: governors: further cleanups Viresh Kumar
2015-10-13  8:09 ` [PATCH V3 1/5] cpufreq: ondemand: Drop unnecessary locks from update_sampling_rate() Viresh Kumar
2015-10-13  8:09   ` Viresh Kumar
2015-10-28  4:05   ` Rafael J. Wysocki
2015-10-28  4:44     ` Viresh Kumar
2015-10-28  5:54       ` Rafael J. Wysocki
2015-10-28  6:43         ` Viresh Kumar
2015-10-28  7:46           ` Rafael J. Wysocki
2015-10-28  8:56             ` Viresh Kumar
2015-10-13  8:09 ` [PATCH V3 2/5] cpufreq: ondemand: update sampling rate immediately Viresh Kumar
2015-10-13  8:09   ` Viresh Kumar
2015-10-28  6:28   ` Rafael J. Wysocki
2015-10-28  9:31     ` Viresh Kumar [this message]
2015-10-28 15:31       ` Rafael J. Wysocki
2015-10-28 15:28         ` Viresh Kumar
2015-10-28 16:13           ` Rafael J. Wysocki
2015-10-28 15:47             ` Viresh Kumar
2015-10-13  8:09 ` [PATCH V3 3/5] cpufreq: ondemand: queue work for policy->cpus together Viresh Kumar
2015-10-13  8:09   ` Viresh Kumar
2015-10-28  6:38   ` Rafael J. Wysocki
2015-10-28  6:46     ` Viresh Kumar
2015-10-28  7:33       ` Rafael J. Wysocki
2015-10-28  8:34         ` Viresh Kumar
2015-10-13  8:09 ` [PATCH V3 4/5] cpufreq: governor: Quit work-handlers early if governor is stopped Viresh Kumar
2015-10-13  8:09   ` Viresh Kumar
2015-10-28  7:10   ` Rafael J. Wysocki
2015-10-28  8:25     ` Viresh Kumar
2015-10-28 15:12       ` Rafael J. Wysocki
2015-10-28 14:46         ` Viresh Kumar
2015-10-13  8:09 ` [PATCH V3 5/5] cpufreq: Get rid of ->governor_enabled and its lock Viresh Kumar
2015-10-13  8:09   ` 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=20151028093109.GJ30039@ubuntu \
    --to=viresh.kumar@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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.