diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 08:10:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-29 08:10:38 -0700 |
commit | 6e958d73c25eecaf02a1998cda9ec8ce8da11042 (patch) | |
tree | 94b8d48d268297925aa02f8ab358274f878bae9e /kernel | |
parent | 7811a32407b971d9086c46403124f1453b95c430 (diff) | |
parent | 92f6a5e37a2e2d3342dafb2b39c2f8bc340bbf84 (diff) | |
download | op-kernel-dev-6e958d73c25eecaf02a1998cda9ec8ce8da11042.zip op-kernel-dev-6e958d73c25eecaf02a1998cda9ec8ce8da11042.tar.gz |
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Do less agressive buddy clearing
sched: Disable SD_PREFER_LOCAL for MC/CPU domains
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 4e777b4..c32c3e6 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -861,12 +861,21 @@ wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se); static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) { struct sched_entity *se = __pick_next_entity(cfs_rq); + struct sched_entity *buddy; - if (cfs_rq->next && wakeup_preempt_entity(cfs_rq->next, se) < 1) - return cfs_rq->next; + if (cfs_rq->next) { + buddy = cfs_rq->next; + cfs_rq->next = NULL; + if (wakeup_preempt_entity(buddy, se) < 1) + return buddy; + } - if (cfs_rq->last && wakeup_preempt_entity(cfs_rq->last, se) < 1) - return cfs_rq->last; + if (cfs_rq->last) { + buddy = cfs_rq->last; + cfs_rq->last = NULL; + if (wakeup_preempt_entity(buddy, se) < 1) + return buddy; + } return se; } @@ -1654,16 +1663,6 @@ static struct task_struct *pick_next_task_fair(struct rq *rq) do { se = pick_next_entity(cfs_rq); - /* - * If se was a buddy, clear it so that it will have to earn - * the favour again. - * - * If se was not a buddy, clear the buddies because neither - * was elegible to run, let them earn it again. - * - * IOW. unconditionally clear buddies. - */ - __clear_buddies(cfs_rq, NULL); set_next_entity(cfs_rq, se); cfs_rq = group_cfs_rq(se); } while (cfs_rq); |