From: Srivatsa Vaddagiri Date: Mon, 15 Oct 2007 15:00:12 +0000 (+0200) Subject: sched: group scheduler, fix latency X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9fa3df33f9166daf81bfa8253d339f5a7726122;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git sched: group scheduler, fix latency There is a possibility that because of task of a group moving from one cpu to another, it may gain more cpu time that desired. See http://marc.info/?l=linux-kernel&m=119073197730334 for details. This is an attempt to fix that problem. Basically it simulates dequeue of higher level entities as if they are going to sleep. Similarly it simulate wakeup of higher level entities as if they are waking up from sleep. Signed-off-by: Srivatsa Vaddagiri Signed-off-by: Ingo Molnar Reviewed-by: Thomas Gleixner --- diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 57e7f3672fd7..de13a6f5b977 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -727,6 +727,7 @@ static void enqueue_task_fair(struct rq *rq, struct task_struct *p, int wakeup) break; cfs_rq = cfs_rq_of(se); enqueue_entity(cfs_rq, se, wakeup); + wakeup = 1; } } @@ -746,6 +747,7 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep) /* Don't dequeue parent if it has other entities besides us */ if (cfs_rq->load.weight) break; + sleep = 1; } }