diff options
-rw-r--r-- | kernel/sched_fair.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 4de9905228c4..a785e08202cf 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -995,19 +995,35 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) | |||
995 | list_add_leaf_cfs_rq(cfs_rq); | 995 | list_add_leaf_cfs_rq(cfs_rq); |
996 | } | 996 | } |
997 | 997 | ||
998 | static void __clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) | 998 | static void __clear_buddies_last(struct sched_entity *se) |
999 | { | 999 | { |
1000 | if (!se || cfs_rq->last == se) | 1000 | for_each_sched_entity(se) { |
1001 | cfs_rq->last = NULL; | 1001 | struct cfs_rq *cfs_rq = cfs_rq_of(se); |
1002 | if (cfs_rq->last == se) | ||
1003 | cfs_rq->last = NULL; | ||
1004 | else | ||
1005 | break; | ||
1006 | } | ||
1007 | } | ||
1002 | 1008 | ||
1003 | if (!se || cfs_rq->next == se) | 1009 | static void __clear_buddies_next(struct sched_entity *se) |
1004 | cfs_rq->next = NULL; | 1010 | { |
1011 | for_each_sched_entity(se) { | ||
1012 | struct cfs_rq *cfs_rq = cfs_rq_of(se); | ||
1013 | if (cfs_rq->next == se) | ||
1014 | cfs_rq->next = NULL; | ||
1015 | else | ||
1016 | break; | ||
1017 | } | ||
1005 | } | 1018 | } |
1006 | 1019 | ||
1007 | static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) | 1020 | static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) |
1008 | { | 1021 | { |
1009 | for_each_sched_entity(se) | 1022 | if (cfs_rq->last == se) |
1010 | __clear_buddies(cfs_rq_of(se), se); | 1023 | __clear_buddies_last(se); |
1024 | |||
1025 | if (cfs_rq->next == se) | ||
1026 | __clear_buddies_next(se); | ||
1011 | } | 1027 | } |
1012 | 1028 | ||
1013 | static void | 1029 | static void |