瀏覽代碼

[PATCH] improve scheduler fairness a bit

Do not transfer remaining time slice to another cpu on process exit.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Oleg Nesterov 19 年之前
父節點
當前提交
889dfafe83
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kernel/sched.c

+ 1 - 1
kernel/sched.c

@@ -1468,7 +1468,7 @@ void fastcall sched_exit(task_t *p)
 	 * the sleep_avg of the parent as well.
 	 */
 	rq = task_rq_lock(p->parent, &flags);
-	if (p->first_time_slice) {
+	if (p->first_time_slice && task_cpu(p) == task_cpu(p->parent)) {
 		p->parent->time_slice += p->time_slice;
 		if (unlikely(p->parent->time_slice > task_timeslice(p)))
 			p->parent->time_slice = task_timeslice(p);