Skip to content

Commit

Permalink
sched: remove redundant hierarchy walk in check_preempt_wakeup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Turner authored and Ingo Molnar committed Apr 9, 2009
1 parent e3c8ca8 commit 002f128
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,17 +1487,10 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)

find_matching_se(&se, &pse);

while (se) {
BUG_ON(!pse);
BUG_ON(!pse);

if (wakeup_preempt_entity(se, pse) == 1) {
resched_task(curr);
break;
}

se = parent_entity(se);
pse = parent_entity(pse);
}
if (wakeup_preempt_entity(se, pse) == 1)
resched_task(curr);
}

static struct task_struct *pick_next_task_fair(struct rq *rq)
Expand Down

0 comments on commit 002f128

Please sign in to comment.