Re: [patch v2 1/2] sched: check for prev_cpu == this_cpu beforecalling wake_affine()
From: Mike Galbraith
Date: Fri Apr 02 2010 - 15:43:43 EST
On Fri, 2010-04-02 at 10:05 -0700, Suresh Siddha wrote:
> On Thu, 2010-04-01 at 23:20 -0700, Mike Galbraith wrote:
> > Yes, if task A and task B are more or less unrelated, you'd want them to
> > stay in separate domains, you'd not want some random event to pull. The
> > other side of the coin is tasks which fork off partners that they will
> > talk to at high frequency. They land just as far away, and desperately
> > need to move into a shared cache domain. There's currently no
> > discriminator, so while always asking wake_affine() may reduce the risk
> > of moving a task with a large footprint, it also increases the risk of
> > leaving buddies jabbering cross cache.
> Mike, Apart from this small tweak that you added in wake_up() path there
> is no extra logic that keeps buddies together for long.
The wakeup logic is the only thing that keeps buddies together.
> As I was saying,
> fork/exec balance starts apart and in the partial loaded case (i.e.,
> when # of running tasks <= # of sockets or # of total cores) the default
> load balancer policy also tries to distribute the load equally among
> sockets/cores (for peak cache/memory controller bw etc). While the
> wakeup() may keep the buddies on SMT siblings, next load balancing event
> will move them far away. If we need to keep buddies together we need
> more changes than this small tweak.
We very definitely need to keep buddies cache affine. Yes, maybe some
additional logic is needed, as there is a conflict between load types.
A kbuild spreading to the four winds is fine, while netperf jabbering
cross cache is horrible.
> > Do you have a compute load bouncing painfully which this patch cures?
> > I have no strong objections, and the result is certainly easier on the
> > eye. If I were making the decision, I'd want to see some numbers.
> All I saw in the changelog when you added this new tweak was:
> commit 8b911acdf08477c059d1c36c21113ab1696c612b
> Author: Mike Galbraith <efault@xxxxxx>
> Date: Thu Mar 11 17:17:16 2010 +0100
> sched: Fix select_idle_sibling()
> Don't bother with selection when the current cpu is idle. ....
> Is it me or you who need to provide the data for justification for your
> new tweak that changes the current behavior ;)
> I will run some workloads aswell!
Whoa. It was a simple question, no need to get defensive. You need not
provide anything. Forget I even asked, it's not my decision.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/