Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169892
b: refs/heads/master
c: a1f84a3
h: refs/heads/master
v: v3
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Nov 4, 2009
1 parent 8edfd2d commit 16186a6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acc3f5d7cabbfd6cec71f0c1f9900621fa2d6ae7
refs/heads/master: a1f84a3ab8e002159498814eaa7e48c33752b04b
33 changes: 29 additions & 4 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,11 +1372,36 @@ static int select_task_rq_fair(struct task_struct *p, int sd_flag, int wake_flag
want_sd = 0;
}

if (want_affine && (tmp->flags & SD_WAKE_AFFINE) &&
cpumask_test_cpu(prev_cpu, sched_domain_span(tmp))) {
if (want_affine && (tmp->flags & SD_WAKE_AFFINE)) {
int candidate = -1, i;

affine_sd = tmp;
want_affine = 0;
if (cpumask_test_cpu(prev_cpu, sched_domain_span(tmp)))
candidate = cpu;

/*
* Check for an idle shared cache.
*/
if (tmp->flags & SD_PREFER_SIBLING) {
if (candidate == cpu) {
if (!cpu_rq(prev_cpu)->cfs.nr_running)
candidate = prev_cpu;
}

if (candidate == -1 || candidate == cpu) {
for_each_cpu(i, sched_domain_span(tmp)) {
if (!cpu_rq(i)->cfs.nr_running) {
candidate = i;
break;
}
}
}
}

if (candidate >= 0) {
affine_sd = tmp;
want_affine = 0;
cpu = candidate;
}
}

if (!want_sd && !want_affine)
Expand Down

0 comments on commit 16186a6

Please sign in to comment.