mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Juri Lelli <juri.lelli@arm.com>
Cc: Joel Fernandes <joelaf@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Patrick Bellasi <patrick.bellasi@arm.com>,
	Andres Oportus <andresoportus@google.com>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Len Brown <lenb@kernel.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH RFC v5] cpufreq: schedutil: Make iowait boost more energy efficient
Date: Wed, 19 Jul 2017 11:07:11 +0530	[thread overview]
Message-ID: <20170719053711.GA352@vireshk-i7> (raw)
In-Reply-To: <20170718140254.qfsxczbkvrcugrv3@e106622-lin>

On 18-07-17, 15:02, Juri Lelli wrote:
> Mmm, seems to make sense to me. :/
> 
> Would the following work (on top of Joel's v5)? Rationale being that
> only in sugov_set_iowait_boost we might bump freq up (if no iowait_boost
> was set) or start from policy->min. In sugov_iowait_boost (consumer)
> instead we do the decay (if no boosting was pending).
> 
> ---
>  kernel/sched/cpufreq_schedutil.c | 29 +++++++++++++++++++----------
>  1 file changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 46b2479641cc..b270563c15a5 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -171,8 +171,14 @@ static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
>  {
>  	if (flags & SCHED_CPUFREQ_IOWAIT) {
>  		sg_cpu->iowait_boost_pending = true;
> -		sg_cpu->iowait_boost = max(sg_cpu->iowait_boost,
> -					   sg_cpu->sg_policy->policy->min);
> +		if (sg_cpu->iowait_boost) {
> +			/* Bump up 2*current_boost until hitting max */
> +			sg_cpu->iowait_boost = max(sg_cpu->iowait_boost << 1,
> +						   sg_cpu->iowait_boost_max);

And we are back at where we started :)

This wouldn't work because sugov_set_iowait_boost() gets called a lot.
Maybe 10 times within a rate_limit_us period.

The thumb rule is, never double/half the boost from
sugov_set_iowait_boost() :)

-- 
viresh

  reply	other threads:[~2017-07-19  5:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-16  8:04 Joel Fernandes
2017-07-17  8:04 ` Viresh Kumar
2017-07-17 17:35   ` Joel Fernandes
2017-07-18  5:45     ` Viresh Kumar
2017-07-18 14:02       ` Juri Lelli
2017-07-19  5:37         ` Viresh Kumar [this message]
2017-07-19  6:12           ` Joel Fernandes
2017-07-19  4:39       ` Joel Fernandes
2017-07-19  6:19         ` Viresh Kumar
2017-07-20  2:38           ` Joel Fernandes
2017-07-20  3:41             ` Viresh Kumar
2017-07-20 19:49               ` Joel Fernandes
2017-07-21  4:09                 ` Viresh Kumar
2017-07-21  6:02                   ` Joel Fernandes

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=20170719053711.GA352@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=andresoportus@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joelaf@google.com \
    --cc=juri.lelli@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.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

all inboxes | Powered by JetHome®