浏览代码

sched: remove condition from set_task_cpu()

remove condition from set_task_cpu(). Now that ->vruntime
is not global anymore, it should (and does) work fine without
it too.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Ingo Molnar 17 年之前
父节点
当前提交
785c29ef95
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      kernel/sched.c

+ 1 - 3
kernel/sched.c

@@ -1052,9 +1052,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
 	if (p->se.block_start)
 		p->se.block_start -= clock_offset;
 #endif
-	if (likely(new_rq->cfs.min_vruntime))
-		p->se.vruntime -= old_rq->cfs.min_vruntime -
-						new_rq->cfs.min_vruntime;
+	p->se.vruntime -= old_rq->cfs.min_vruntime - new_rq->cfs.min_vruntime;
 
 	__set_task_cpu(p, new_cpu);
 }