diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched_fair.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 51aa3e102acb..98345e45b059 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -716,6 +716,15 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int wakeup) | |||
716 | __enqueue_entity(cfs_rq, se); | 716 | __enqueue_entity(cfs_rq, se); |
717 | } | 717 | } |
718 | 718 | ||
719 | static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) | ||
720 | { | ||
721 | if (cfs_rq->last == se) | ||
722 | cfs_rq->last = NULL; | ||
723 | |||
724 | if (cfs_rq->next == se) | ||
725 | cfs_rq->next = NULL; | ||
726 | } | ||
727 | |||
719 | static void | 728 | static void |
720 | dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) | 729 | dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) |
721 | { | 730 | { |
@@ -738,11 +747,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) | |||
738 | #endif | 747 | #endif |
739 | } | 748 | } |
740 | 749 | ||
741 | if (cfs_rq->last == se) | 750 | clear_buddies(cfs_rq, se); |
742 | cfs_rq->last = NULL; | ||
743 | |||
744 | if (cfs_rq->next == se) | ||
745 | cfs_rq->next = NULL; | ||
746 | 751 | ||
747 | if (se != cfs_rq->curr) | 752 | if (se != cfs_rq->curr) |
748 | __dequeue_entity(cfs_rq, se); | 753 | __dequeue_entity(cfs_rq, se); |
@@ -977,6 +982,8 @@ static void yield_task_fair(struct rq *rq) | |||
977 | if (unlikely(cfs_rq->nr_running == 1)) | 982 | if (unlikely(cfs_rq->nr_running == 1)) |
978 | return; | 983 | return; |
979 | 984 | ||
985 | clear_buddies(cfs_rq, se); | ||
986 | |||
980 | if (likely(!sysctl_sched_compat_yield) && curr->policy != SCHED_BATCH) { | 987 | if (likely(!sysctl_sched_compat_yield) && curr->policy != SCHED_BATCH) { |
981 | update_rq_clock(rq); | 988 | update_rq_clock(rq); |
982 | /* | 989 | /* |