All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Morten Rasmussen <morten.rasmussen@arm.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
	mingo@kernel.org, linux-kernel@vger.kernel.org,
	matt@codeblueprint.co.uk, dietmar.eggemann@arm.com,
	kernellwp@gmail.com, yuyang.du@intel.com,
	umgwanakikbuti@gmail.com
Subject: Re: [PATCH 1/2 v2] sched: fix find_idlest_group for fork
Date: Mon, 5 Dec 2016 09:48:56 +0100	[thread overview]
Message-ID: <20161205084856.GR3092@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20161129144609.GB1716@e105550-lin.cambridge.arm.com>

On Tue, Nov 29, 2016 at 02:46:10PM +0000, Morten Rasmussen wrote:
> On Tue, Nov 29, 2016 at 12:42:43PM +0100, Peter Zijlstra wrote:
> > On Tue, Nov 29, 2016 at 10:57:59AM +0000, Morten Rasmussen wrote:
> > > > @@ -5708,13 +5708,6 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
> > > >  
> > > >  	avg_cost = this_sd->avg_scan_cost;
> > > >  
> > > > -	/*
> > > > -	 * Due to large variance we need a large fuzz factor; hackbench in
> > > > -	 * particularly is sensitive here.
> > > > -	 */
> > > > -	if ((avg_idle / 512) < avg_cost)
> > > > -		return -1;
> > > > -

> The last bit that isn't clear to me is whether /512 is a 'large' fuzz
> factor. I guess it is, as we can have many wake-ups, i.e. many times
> avg_cost, over the period where avg_idle is calculated. No?


So the idea was to not spend more time looking for work than we're
actually going to be idle for, since then we're wasting time we could've
done work.

So avg_idle and avg_cost are equal measure in that the immediate
inequality would be: if (avg_idle < avg_cost) stop().

Of course, both being averages with unknown distribution makes that a
tricky proposition, and that also makes the 512 hard to quantify. Still
a factor of 512 of the total average, where our variable cannot go
negative (negative time intervals are nonsensical), is fairly large.

  reply	other threads:[~2016-12-05  8:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 15:34 [PATCH 0/2 v2] sched: improve spread of tasks during fork Vincent Guittot
2016-11-25 15:34 ` [PATCH 1/2 v2] sched: fix find_idlest_group for fork Vincent Guittot
2016-11-28 17:01   ` Matt Fleming
2016-11-28 17:20     ` Vincent Guittot
2016-11-29 10:57   ` Morten Rasmussen
2016-11-29 11:42     ` Peter Zijlstra
2016-11-29 11:44       ` Matt Fleming
2016-11-29 12:30         ` Peter Zijlstra
2016-11-29 14:46       ` Morten Rasmussen
2016-12-05  8:48         ` Peter Zijlstra [this message]
2016-11-29 13:04     ` Vincent Guittot
2016-11-29 14:50       ` Morten Rasmussen
2016-11-29 14:57         ` Vincent Guittot
2016-12-03 23:25   ` Matt Fleming
2016-12-05  9:17     ` Vincent Guittot
2016-11-25 15:34 ` [PATCH 2/2 v2] sched: use load_avg for selecting idlest group Vincent Guittot
2016-11-30 12:49   ` Morten Rasmussen
2016-11-30 13:49     ` Vincent Guittot
2016-11-30 13:54       ` Vincent Guittot
2016-11-30 14:24         ` Morten Rasmussen
2016-12-02 15:20           ` Vincent Guittot
2016-12-02 22:24             ` Matt Fleming
2016-11-30 14:23       ` Morten Rasmussen
2016-12-03  3:31   ` Brendan Gregg
2016-12-03 21:47     ` Matt Fleming
2016-12-05  9:27       ` Vincent Guittot
2016-12-05 13:35         ` Matt Fleming
2016-12-08 14:09           ` Matt Fleming
2016-12-08 14:33             ` Vincent Guittot
2016-11-28 17:02 ` [PATCH 0/2 v2] sched: improve spread of tasks during fork Matt Fleming
2016-11-28 17:20   ` Vincent Guittot

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=20161205084856.GR3092@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=kernellwp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=morten.rasmussen@arm.com \
    --cc=umgwanakikbuti@gmail.com \
    --cc=vincent.guittot@linaro.org \
    --cc=yuyang.du@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 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.