aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>2007-10-15 11:00:12 -0400
committerIngo Molnar <mingo@elte.hu>2007-10-15 11:00:12 -0400
commit8651a86c342ab79a956afec0c5971acaad38d3a1 (patch)
treeb83e5ba4a69ce150d857892a12ba13641e995672 /kernel
parent57cb499df26d80ec11cd49e56d20835334ac4ab9 (diff)
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)
796static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) 796static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
797{ 797{
798 struct task_struct *curr = rq->curr; 798 struct task_struct *curr = rq->curr;
799 struct cfs_rq *cfs_rq = task_cfs_rq(curr); 799 struct cfs_rq *cfs_rq = task_cfs_rq(curr), *pcfs_rq;
800 struct sched_entity *se = &curr->se, *pse = &p->se;
800 801
801 if (unlikely(rt_prio(p->prio))) { 802 if (unlikely(rt_prio(p->prio))) {
802 update_rq_clock(rq); 803 update_rq_clock(rq);
@@ -804,11 +805,21 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
804 resched_task(curr); 805 resched_task(curr);
805 return; 806 return;
806 } 807 }
807 if (is_same_group(curr, p)) {
808 s64 delta = curr->se.vruntime - p->se.vruntime;
809 808
810 if (delta > (s64)sysctl_sched_wakeup_granularity) 809 for_each_sched_entity(se) {
811 resched_task(curr); 810 cfs_rq = cfs_rq_of(se);
811 pcfs_rq = cfs_rq_of(pse);
812
813 if (cfs_rq == pcfs_rq) {
814 s64 delta = se->vruntime - pse->vruntime;
815
816 if (delta > (s64)sysctl_sched_wakeup_granularity)
817 resched_task(curr);
818 break;
819 }
820#ifdef CONFIG_FAIR_GROUP_SCHED
821 pse = pse->parent;
822#endif
812 } 823 }
813} 824}
814 825