[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.00.0904081520320.30317@kitami.corp.google.com>
Date: Wed, 8 Apr 2009 15:29:43 -0700 (PDT)
From: Paul Turner <pjt@...gle.com>
To: mingo@...e.hu, peterz@...radead.org, linux-kernel@...r.kernel.org
Subject: sched: remove redundant hierarchy walk in check_preempt_wakeup
Hi Ingo, Peter,
In check_preempt_wakeup we walk up until both entities are queued on the
same cfs_rq. After the iteration of vruntime vs wall-clock pre-emption
changes the current check now checks at every level of the tree above
this. However, unless I'm missing something at this point they should
have a common parent.
Thanks,
- Paul
--
sched: remove redundant hierarchy walk in check_preempt_wakeup
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@...gle.com>
---
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 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)
--
1.5.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists