linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Quentin Perret <quentin.perret@arm.com>
Cc: "Wang, Vincent (王争)" <Vincent.Wang@unisoc.com>,
	"Zhang, Chunyan (张春艳)" <Chunyan.Zhang@unisoc.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chunyan Zhang" <zhang.lyra@gmail.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: 答复: [PATCH V4] sched/cpufreq: initialize iowait_boost_max and iowait_boost with cpu capacity
Date: Mon, 4 Mar 2019 19:47:08 +0100	[thread overview]
Message-ID: <20190304184708.GQ32494@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190304175030.4slf247y2eftkmu4@queper01-lin>

On Mon, Mar 04, 2019 at 05:50:32PM +0000, Quentin Perret wrote:
> On Monday 04 Mar 2019 at 18:40:28 (+0100), Peter Zijlstra wrote:
> > > Perhaps you could keep the 'util' and 'max' pointers in
> > > sugov_iowait_apply() and overwrite them like before, but in the
> > > SCHED_CAPACITY_SCALE scale as you suggest ?
> > 
> > Urgh; but then we're back to having that boostrap problem.
> 
> Hmm, I don't understand :/

Yeah, I seen to have reading comprehension issues today. Ignore that.

> > Now; at this time; @max is in fact scale_cpu_capacity, so can't we
> > change this:
> > 
> > -       /*
> > -        * Apply the current boost value: a CPU is boosted only if its current
> > -        * utilization is smaller then the current IO boost level.
> > -        */
> > -       boost_util = sg_cpu->iowait_boost;
> > -       boost_max = sg_cpu->iowait_boost_max;
> 
> I was basically suggesting to do 'boost_max = 1024;' here and you
> should be good with you way of computing 'min' no ?

Right, but then we keep having to retain those two mults.

> > -       if (*util * boost_max < *max * boost_util) {
> > -               *util = boost_util;
> > -               *max = boost_max;
> > -       }
> > +       sg_cpu->iowait_boost_pending = false;
> > +
> > +       return min(max(util, sg_cpu->iowait_boost), max);
> > }
> > 
> > to something like:
> > 
> > 	/*
> > 	 * @util is already in capacity scale, convert iowait_boost
> > 	 * into the same scale so we can compare.
> > 	 */
> > 	boost = (sg_cpu->iowait_boost * max) >> SCHED_CAPACITY_SHIFT;
> > 	util = max(boost, util);
> > 	return min(util, max);
> > 
> 
> But this should work too, I think.

While that is only a single mult.

  reply	other threads:[~2019-03-04 18:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 10:37 [PATCH V4] sched/cpufreq: initialize iowait_boost_max and iowait_boost with cpu capacity Chunyan Zhang
2019-02-22 10:59 ` Quentin Perret
2019-03-04  7:35   ` 答复: " Wang, Vincent (王争)
2019-03-04 13:58     ` Quentin Perret
2019-03-04 15:26       ` Peter Zijlstra
2019-03-04 16:48         ` Quentin Perret
2019-03-04 17:40           ` Peter Zijlstra
2019-03-04 17:44             ` Peter Zijlstra
2019-03-04 17:50             ` Quentin Perret
2019-03-04 18:47               ` Peter Zijlstra [this message]
2019-03-04 19:11                 ` Quentin Perret
2019-03-05  8:32                   ` [PATCH] sched/cpufreq: Fix 32bit math overflow Peter Zijlstra
2019-03-05 10:55                     ` Rafael J. Wysocki
2019-03-06  2:01                     ` Chunyan Zhang
2019-03-06  7:50                     ` Chunyan Zhang
2019-03-09 14:35                     ` [tip:sched/urgent] sched/cpufreq: Fix 32-bit " tip-bot for Peter Zijlstra
2019-03-19 11:10                     ` tip-bot for Peter Zijlstra
2019-03-04 17:40           ` 答复: [PATCH V4] sched/cpufreq: initialize iowait_boost_max and iowait_boost with cpu capacity Vincent Guittot
2019-03-04 17:49           ` Peter Zijlstra

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=20190304184708.GQ32494@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=Chunyan.Zhang@unisoc.com \
    --cc=Vincent.Wang@unisoc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=quentin.perret@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=zhang.lyra@gmail.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;
as well as URLs for NNTP newsgroup(s).