Commit 97a7142f authored by Byungchul Park's avatar Byungchul Park Committed by Ingo Molnar

sched/fair: Make update_min_vruntime() more readable

The update_min_vruntime() control flow can be simplified.
Signed-off-by: default avatarByungchul Park <byungchul.park@lge.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: minchan.kim@lge.com
Link: http://lkml.kernel.org/r/1436088829-25768-1-git-send-email-byungchul.park@lge.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 62cc20bc
...@@ -464,20 +464,17 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq) ...@@ -464,20 +464,17 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
{ {
u64 vruntime = cfs_rq->min_vruntime; u64 vruntime = cfs_rq->min_vruntime;
if (cfs_rq->curr)
vruntime = cfs_rq->curr->vruntime;
if (cfs_rq->rb_leftmost) { if (cfs_rq->rb_leftmost) {
struct sched_entity *se = rb_entry(cfs_rq->rb_leftmost, struct sched_entity *se = rb_entry(cfs_rq->rb_leftmost,
struct sched_entity, struct sched_entity,
run_node); run_node);
if (!cfs_rq->curr)
vruntime = se->vruntime; 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. */ /* ensure we never gain time by being placed backwards. */
cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime); cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
#ifndef CONFIG_64BIT #ifndef CONFIG_64BIT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment