lkml.org 
[lkml]   [2013]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH] sched: Avoid select_idle_sibling() for wake_affine(.sync=true)
From
Date
On Thu, 2013-09-26 at 10:50 +0800, Michael wang wrote: 
> On 09/25/2013 04:56 PM, Mike Galbraith wrote:
> > On Wed, 2013-09-25 at 09:53 +0200, Peter Zijlstra wrote:
> >> Subject: sched: Avoid select_idle_sibling() for wake_affine(.sync=true)
> >> From: Peter Zijlstra <peterz@infradead.org>
> >> Date: Wed Sep 25 08:28:39 CEST 2013
> >>
> >> When a task is the only running task and does a sync wakeup; avoid
> >> going through select_idle_sibling() as it doesn't know the current CPU
> >> is going to be idle shortly.
> >>
> >> Without this two sync wakers will ping-pong between CPUs for no
> >> reason.
> >
> > That will make pipe-test go fugly -> pretty, and help very fast/light
> > localhost network, but eat heavier localhost overlap recovery. We need
> > a working (and cheap) overlap detector scheme, so we can know when there
> > is enough to be worth going after.
> >
> > (I sent you some lmbench numbers offline a while back showing the
> > two-faced little <b-word> in action, doing both good and evil)
>
> It seems like the choice between the overhead and a little possibility
> to balance the load :)
>
> Like the case when we have:
>
> core0 sg core1 sg
> cpu0 cpu1 cpu2 cpu3
> waker busy idle idle
>
> If the sync wakeup was on cpu0, we can:
>
> 1. choose cpu in core1 sg like we did usually
> some overhead but tend to make the load a little balance
> core0 sg core1 sg
> cpu0 cpu1 cpu2 cpu3
> idle busy wakee idle

Reducing latency and increasing throughput when the waker isn't really
really going to immediately schedule off as the hint implies. Nice for
bursty loads and ramp.

The breakeven point is going up though. If you don't have nohz
throttled, you eat tick start/stop overhead, and the menu governor
recently added yet more overhead, so maybe we should say hell with it.

> 2. choose cpu0 like the patch proposed
> no overhead but tend to make the load a little more unbalance
> core0 sg core1 sg
> cpu0 cpu1 cpu2 cpu3
> wakee busy idle idle
>
> May be we should add a higher scope load balance check in wake_affine(),
> but that means higher overhead which is just what the patch want to
> reduce...

Yeah, more overhead is the last thing we need.

> What about some discount for sync case inside select_idle_sibling()?
> For example we consider sync cpu as idle and prefer it more than the others?

That's what the sync hint does. Problem is, it's a hint. If it were
truth, there would be no point in calling select_idle_sibling().

-Mike



\
 
 \ /
  Last update: 2013-09-26 06:01    [W:0.091 / U:2.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site