Skip to content

Commit

Permalink
[PATCH] improve scheduler fairness a bit
Browse files Browse the repository at this point in the history
Do not transfer remaining time slice to another cpu on process exit.

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Ingo Molnar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Nov 4, 2005
1 parent c8ebce6 commit 889dfaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 889dfaf

Please sign in to comment.