diff options
author | Paul Turner <pjt@google.com> | 2009-04-08 18:29:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-09 02:19:08 -0400 |
commit | 002f128b473fb82f454654be5081b0919ee01ab2 (patch) | |
tree | 5425166733e7439257325e1f3f104fa48e416024 /kernel | |
parent | e3c8ca8336707062f3f7cb1cd7e6b3c753baccdd (diff) |
sched: remove redundant hierarchy walk in check_preempt_wakeup
Impact: micro-optimization
Under group scheduling we traverse up until we are at common siblings
to make the wakeup comparison on.
At this point however, they should have the same parent so continuing
to check up the tree is redundant.
Signed-off-by: Paul Turner <pjt@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <alpine.DEB.1.00.0904081520320.30317@kitami.corp.google.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 3816f217f119..5f9650e8fe75 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -1487,17 +1487,10 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) | |||
1487 | 1487 | ||
1488 | find_matching_se(&se, &pse); | 1488 | find_matching_se(&se, &pse); |
1489 | 1489 | ||
1490 | while (se) { | 1490 | BUG_ON(!pse); |
1491 | BUG_ON(!pse); | ||
1492 | 1491 | ||
1493 | if (wakeup_preempt_entity(se, pse) == 1) { | 1492 | if (wakeup_preempt_entity(se, pse) == 1) |
1494 | resched_task(curr); | 1493 | resched_task(curr); |
1495 | break; | ||
1496 | } | ||
1497 | |||
1498 | se = parent_entity(se); | ||
1499 | pse = parent_entity(pse); | ||
1500 | } | ||
1501 | } | 1494 | } |
1502 | 1495 | ||
1503 | static struct task_struct *pick_next_task_fair(struct rq *rq) | 1496 | static struct task_struct *pick_next_task_fair(struct rq *rq) |