summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>2007-10-15 17:00:12 +0200
committerIngo Molnar <mingo@elte.hu>2007-10-15 17:00:12 +0200
commit8651a86c342ab79a956afec0c5971acaad38d3a1 (patch)
treeb83e5ba4a69ce150d857892a12ba13641e995672 /kernel
parentsched: remove set_leftmost() (diff)
downloadlinux-8651a86c342ab79a956afec0c5971acaad38d3a1.tar.xz
linux-8651a86c342ab79a956afec0c5971acaad38d3a1.zip
sched: group scheduler wakeup latency fix
group scheduler wakeup latency fix: when checking for preemption we must check cross-group too, not just intra-group. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_fair.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 48c69211888f..5384a977c9a7 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -796,7 +796,8 @@ static void yield_task_fair(struct rq *rq)
static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
{
struct task_struct *curr = rq->curr;
- struct cfs_rq *cfs_rq = task_cfs_rq(curr);
+ struct cfs_rq *cfs_rq = task_cfs_rq(curr), *pcfs_rq;
+ struct sched_entity *se = &curr->se, *pse = &p->se;
if (unlikely(rt_prio(p->prio))) {
update_rq_clock(rq);
@@ -804,11 +805,21 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
resched_task(curr);
return;
}
- if (is_same_group(curr, p)) {
- s64 delta = curr->se.vruntime - p->se.vruntime;
- if (delta > (s64)sysctl_sched_wakeup_granularity)
- resched_task(curr);
+ for_each_sched_entity(se) {
+ cfs_rq = cfs_rq_of(se);
+ pcfs_rq = cfs_rq_of(pse);
+
+ if (cfs_rq == pcfs_rq) {
+ s64 delta = se->vruntime - pse->vruntime;
+
+ if (delta > (s64)sysctl_sched_wakeup_granularity)
+ resched_task(curr);
+ break;
+ }
+#ifdef CONFIG_FAIR_GROUP_SCHED
+ pse = pse->parent;
+#endif
}
}