aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 74dc29ba1ad1..db788222f198 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1102,6 +1102,26 @@ static inline u64 __synchronize_entity_decay(struct sched_entity *se)
1102 return decays; 1102 return decays;
1103} 1103}
1104 1104
1105#ifdef CONFIG_FAIR_GROUP_SCHED
1106static inline void __update_cfs_rq_tg_load_contrib(struct cfs_rq *cfs_rq,
1107 int force_update)
1108{
1109 struct task_group *tg = cfs_rq->tg;
1110 s64 tg_contrib;
1111
1112 tg_contrib = cfs_rq->runnable_load_avg + cfs_rq->blocked_load_avg;
1113 tg_contrib -= cfs_rq->tg_load_contrib;
1114
1115 if (force_update || abs64(tg_contrib) > cfs_rq->tg_load_contrib / 8) {
1116 atomic64_add(tg_contrib, &tg->load_avg);
1117 cfs_rq->tg_load_contrib += tg_contrib;
1118 }
1119}
1120#else
1121static inline void __update_cfs_rq_tg_load_contrib(struct cfs_rq *cfs_rq,
1122 int force_update) {}
1123#endif
1124
1105/* Compute the current contribution to load_avg by se, return any delta */ 1125/* Compute the current contribution to load_avg by se, return any delta */
1106static long __update_entity_load_avg_contrib(struct sched_entity *se) 1126static long __update_entity_load_avg_contrib(struct sched_entity *se)
1107{ 1127{
@@ -1172,6 +1192,8 @@ static void update_cfs_rq_blocked_load(struct cfs_rq *cfs_rq, int force_update)
1172 atomic64_add(decays, &cfs_rq->decay_counter); 1192 atomic64_add(decays, &cfs_rq->decay_counter);
1173 cfs_rq->last_decay = now; 1193 cfs_rq->last_decay = now;
1174 } 1194 }
1195
1196 __update_cfs_rq_tg_load_contrib(cfs_rq, force_update);
1175} 1197}
1176 1198
1177static inline void update_rq_runnable_avg(struct rq *rq, int runnable) 1199static inline void update_rq_runnable_avg(struct rq *rq, int runnable)