Messages in this thread | | | Subject | Re: sched: Avoid SMT siblings in select_idle_sibling() if possible | From | Mike Galbraith <> | Date | Thu, 17 Nov 2011 17:38:37 +0100 |
| |
On Thu, 2011-11-17 at 16:56 +0100, Peter Zijlstra wrote: > On Thu, 2011-11-17 at 16:38 +0100, Mike Galbraith wrote: > > On Thu, 2011-11-17 at 02:59 +0100, Mike Galbraith wrote: > > > On Wed, 2011-11-16 at 10:37 -0800, Suresh Siddha wrote: > > > > > > It should be ok. Isn't it? > > > > > > Nope, wasn't ok. > > > > Because you can't get to again: with a single E5620 package, it having > > only SIBLING and MC domains. > > > > again: > > for_each_domain(target, sd) { > > if (!smt && (sd->flags & SD_SHARE_CPUPOWER)) > > continue; > > > > if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) { > > if (!smt) { > > smt = 1; > > goto again; > > > > D'0h, indeed.. > > Something like the below maybe, although I'm certain it all can be > written much nicer indeed.
I'll give it a go.
Squabbling with bouncing buddies in an isolated and otherwise idle cpuset ate my day.
> --- > kernel/sched/fair.c | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index cd3b642..340e62e 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -2676,13 +2676,11 @@ static int select_idle_sibling(struct task_struct *p, int target) > if (!smt && (sd->flags & SD_SHARE_CPUPOWER)) > continue; > > - if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) { > - if (!smt) { > - smt = 1; > - goto again; > - } > + if (smt && !(sd->flags & SD_SHARE_CPUPOWER)) > + break; > + > + if (!(sd->flags & SD_SHARE_PKG_RESOURCES)) > break; > - } > > sg = sd->groups; > do { > @@ -2702,6 +2700,10 @@ static int select_idle_sibling(struct task_struct *p, int target) > sg = sg->next; > } while (sg != sd->groups); > } > + if (!smt) { > + smt = 1; > + goto again; > + } > done: > rcu_read_unlock(); > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/
| |