Re: [RFC][PATCH 5/7] sched: Rewrite select_idle_siblings()
From: Yuyang Du
Date: Wed May 11 2016 - 03:24:23 EST
On Wed, May 11, 2016 at 09:00:29AM +0200, Peter Zijlstra wrote:
> On Wed, May 11, 2016 at 05:05:50AM +0800, Yuyang Du wrote:
> > On Mon, May 09, 2016 at 12:48:12PM +0200, Peter Zijlstra wrote:
> > > + i = select_idle_core(p, sd, target);
> > > + if ((unsigned)i < nr_cpumask_bits)
> > > + return i;
> > > +
> > > + i = select_idle_cpu(p, sd, target);
> > > + if ((unsigned)i < nr_cpumask_bits)
> > > + return i;
> > > +
> > > + i = select_idle_smt(p, sd, target);
> > > + if ((unsigned)i < nr_cpumask_bits)
> > > + return i;
> >
> > First, on smt, these three scans have a lot of overlap,
>
> Limited, we stop doing the idle_core scan the moment we fail to find
> one. And on a busy system it is unlikely to come back.
>
> Which leaves us with the straight idle_cpu scan. Sure, the one time we
> fail to find an idle core and fall through we'll scan double, but that
> should be rare.
Yes, I was sorta well educated about how important finding an idle is ("one
stack, game over"), which therefore is sure worth the effort.
Looks to me, it is just about how much opportunisic-spinning should be applied
here. Great.
Do you have any suggestion about doing other part of select_task_rq_fair?