diff options
-rw-r--r-- | kernel/sched.c | 5 | ||||
-rw-r--r-- | kernel/sched_fair.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index a5dd03522e32..5594e65166fc 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -732,13 +732,14 @@ calc_delta_fair(unsigned long delta_exec, struct load_weight *lw) | |||
732 | static inline void update_load_add(struct load_weight *lw, unsigned long inc) | 732 | static inline void update_load_add(struct load_weight *lw, unsigned long inc) |
733 | { | 733 | { |
734 | lw->weight += inc; | 734 | lw->weight += inc; |
735 | lw->inv_weight = WMULT_CONST / lw->weight; | 735 | if (sched_feat(FAIR_SLEEPERS)) |
736 | lw->inv_weight = WMULT_CONST / lw->weight; | ||
736 | } | 737 | } |
737 | 738 | ||
738 | static inline void update_load_sub(struct load_weight *lw, unsigned long dec) | 739 | static inline void update_load_sub(struct load_weight *lw, unsigned long dec) |
739 | { | 740 | { |
740 | lw->weight -= dec; | 741 | lw->weight -= dec; |
741 | if (likely(lw->weight)) | 742 | if (sched_feat(FAIR_SLEEPERS) && likely(lw->weight)) |
742 | lw->inv_weight = WMULT_CONST / lw->weight; | 743 | lw->inv_weight = WMULT_CONST / lw->weight; |
743 | } | 744 | } |
744 | 745 | ||
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a566a4558167..7041dc697855 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -336,6 +336,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, | |||
336 | } | 336 | } |
337 | curr->vruntime += delta_exec_weighted; | 337 | curr->vruntime += delta_exec_weighted; |
338 | 338 | ||
339 | if (!sched_feat(FAIR_SLEEPERS)) | ||
340 | return; | ||
341 | |||
339 | if (unlikely(!load)) | 342 | if (unlikely(!load)) |
340 | return; | 343 | return; |
341 | 344 | ||