lkml.org 
[lkml]   [2011]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: sched: Avoid SMT siblings in select_idle_sibling() if possible
From
Date
On Tue, 2011-11-15 at 17:14 -0800, Suresh Siddha wrote:

> How about this patch which is more self explanatory?

Actually, after further testing/reading, it looks to me like both of
these patches have a problem. They'll never select SMT siblings (so a
skip SIBLING should accomplish the same).

This patch didn't select an idle core either though, where Peter's did.

Tested by pinning a hog to cores 1-3, then starting up an unpinned
tbench pair. Peter's patch didn't do the BadThing (as in bad for
TCP_RR/tbench) in that case, but should have.

> + sg = sd->groups;
> + do {
> + if (!cpumask_intersects(sched_group_cpus(sg),
> + tsk_cpus_allowed(p)))
> + goto next;
>
> + for_each_cpu(i, sched_group_cpus(sg)) {
> + if (!idle_cpu(i))
> + goto next;

Say target is CPU0. Groups are 0,4 1,5 2,6 3,7. 0-3 are first CPUs
encountered in MC groups, all were busy. At SIBLING level, the only
group is 0,4. First encountered CPU of sole group is busy target, so
we're done.. so we return busy target.

> + target = cpumask_first_and(sched_group_cpus(sg),
> + tsk_cpus_allowed(p));

At SIBLING, group = 0,4 = 0x5, 0x5 & 0xff = 1 = target.

-Mike



\
 
 \ /
  Last update: 2011-11-16 10:27    [W:0.172 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site