summaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2016-09-07 10:29:05 +0200
committerIngo Molnar <mingo@kernel.org>2016-09-10 11:17:40 +0200
commitde58af878d9146e5decc0cdd7acabaa82881cbe4 (patch)
tree4b3a36906b885eb2293263b8c119e3c25851c61b /kernel/sched/fair.c
parent4fa8d299b43a91f871f6d5b00dd5ab33d43bbc2c (diff)
downloadblackbird-op-linux-de58af878d9146e5decc0cdd7acabaa82881cbe4.tar.gz
blackbird-op-linux-de58af878d9146e5decc0cdd7acabaa82881cbe4.zip
Revert "sched/fair: Make update_min_vruntime() more readable"
There's a bug in this commit: 97a7142f157a ("sched/fair: Make update_min_vruntime() more readable") ... when !rb_leftmost && curr we fail to advance min_vruntime. So revert it. Reported-by: Byungchul Park <byungchul.park@lge.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a6820b3771e2..986c10c25176 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -464,17 +464,20 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
{
u64 vruntime = cfs_rq->min_vruntime;
+ if (cfs_rq->curr)
+ vruntime = cfs_rq->curr->vruntime;
+
if (cfs_rq->rb_leftmost) {
struct sched_entity *se = rb_entry(cfs_rq->rb_leftmost,
struct sched_entity,
run_node);
- vruntime = se->vruntime;
+ if (!cfs_rq->curr)
+ vruntime = se->vruntime;
+ else
+ vruntime = min_vruntime(vruntime, se->vruntime);
}
- if (cfs_rq->curr)
- vruntime = min_vruntime(vruntime, cfs_rq->curr->vruntime);
-
/* ensure we never gain time by being placed backwards. */
cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BIT
OpenPOWER on IntegriCloud