[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-1e876231785d82443a5ac8b6c660e9f51bc5dede@git.kernel.org>
Date: Sat, 28 May 2011 16:35:30 GMT
From: tip-bot for Peter Zijlstra <peterz@...radead.org>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, efault@....de, peterz@...radead.org,
john.stultz@...aro.org, dima@...roid.com, tglx@...utronix.de,
mingo@...e.hu
Subject: [tip:sched/urgent] sched: Fix ->min_vruntime calculation in dequeue_entity()
Commit-ID: 1e876231785d82443a5ac8b6c660e9f51bc5dede
Gitweb: http://git.kernel.org/tip/1e876231785d82443a5ac8b6c660e9f51bc5dede
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Tue, 17 May 2011 16:21:10 -0700
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Sat, 28 May 2011 17:02:56 +0200
sched: Fix ->min_vruntime calculation in dequeue_entity()
Dima Zavin <dima@...roid.com> reported:
"After pulling the thread off the run-queue during a cgroup change,
the cfs_rq.min_vruntime gets recalculated. The dequeued thread's vruntime
then gets normalized to this new value. This can then lead to the thread
getting an unfair boost in the new group if the vruntime of the next
task in the old run-queue was way further ahead."
Reported-by: Dima Zavin <dima@...roid.com>
Signed-off-by: John Stultz <john.stultz@...aro.org>
Recalls-having-tested-once-upon-a-time-by: Mike Galbraith <efault@....de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1305674470-23727-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/sched_fair.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index e32a9b7..433491c 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1076,8 +1076,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
se->on_rq = 0;
update_cfs_load(cfs_rq, 0);
account_entity_dequeue(cfs_rq, se);
- update_min_vruntime(cfs_rq);
- update_cfs_shares(cfs_rq);
/*
* Normalize the entity after updating the min_vruntime because the
@@ -1086,6 +1084,9 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
*/
if (!(flags & DEQUEUE_SLEEP))
se->vruntime -= cfs_rq->min_vruntime;
+
+ update_min_vruntime(cfs_rq);
+ update_cfs_shares(cfs_rq);
}
/*
--
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