Re: [patch 1/2] sched: check for prev_cpu == this_cpu inwake_affine()

From: Suresh Siddha
Date: Mon Mar 08 2010 - 14:11:25 EST


hi Mike,

On Fri, 2010-03-05 at 11:36 -0800, Mike Galbraith wrote:
> Yeah, but with the 1 task + non-sync wakeup scenario, we miss the boat
> because select_idle_sibling() uses wake_affine() success as it's
> enabler.

But the wake_affine() decision is broken when this_cpu == prev_cpu. All
we need to do is to fix that, to recover that ~9% improvement.

> I have a slightly different patch for that in my tree. There's no need
> to even call wake_affine() since the result is meaningless.

I don't think your below fix is correct because:


> - if (affine_sd && wake_affine(affine_sd, p, sync))
> - return cpu;
> + if (affine_sd) {
> + if (cpu == prev_cpu)
> + return cpu;


by this time, we have overwritten cpu using the select_idle_sibling()
logic and cpu no longer points to this_cpu.

What we need is a comparison with this_cpu.

thanks,
suresh

--
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/