From: Paul Turner Date: Wed, 8 Apr 2009 22:29:43 +0000 (-0700) Subject: sched: remove redundant hierarchy walk in check_preempt_wakeup X-Git-Tag: upstream/snapshot3+hdmi~18699^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=002f128b473fb82f454654be5081b0919ee01ab2;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Acked-by: Peter Zijlstra LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 3816f21..5f9650e 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) 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)