diff options
-rw-r--r-- | kernel/sched_fair.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index fdc417504681..75248b9ff4c1 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -768,8 +768,14 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) | |||
768 | 768 | ||
769 | ideal_runtime = sched_slice(cfs_rq, curr); | 769 | ideal_runtime = sched_slice(cfs_rq, curr); |
770 | delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; | 770 | delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; |
771 | if (delta_exec > ideal_runtime) | 771 | if (delta_exec > ideal_runtime) { |
772 | resched_task(rq_of(cfs_rq)->curr); | 772 | resched_task(rq_of(cfs_rq)->curr); |
773 | /* | ||
774 | * The current task ran long enough, ensure it doesn't get | ||
775 | * re-elected due to buddy favours. | ||
776 | */ | ||
777 | clear_buddies(cfs_rq, curr); | ||
778 | } | ||
773 | } | 779 | } |
774 | 780 | ||
775 | static void | 781 | static void |
@@ -1445,6 +1451,11 @@ static struct task_struct *pick_next_task_fair(struct rq *rq) | |||
1445 | 1451 | ||
1446 | do { | 1452 | do { |
1447 | se = pick_next_entity(cfs_rq); | 1453 | se = pick_next_entity(cfs_rq); |
1454 | /* | ||
1455 | * If se was a buddy, clear it so that it will have to earn | ||
1456 | * the favour again. | ||
1457 | */ | ||
1458 | clear_buddies(cfs_rq, se); | ||
1448 | set_next_entity(cfs_rq, se); | 1459 | set_next_entity(cfs_rq, se); |
1449 | cfs_rq = group_cfs_rq(se); | 1460 | cfs_rq = group_cfs_rq(se); |
1450 | } while (cfs_rq); | 1461 | } while (cfs_rq); |