diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2020-11-15 21:52:06 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-11-15 21:52:18 +0200 |
commit | 6107aa6dc24cc8c196bb18e5b5ec81f8f1a275a8 (patch) | |
tree | ef508ed8340c5d6b615c713d1569d851964091f2 /kernel/sched | |
parent | 298504ed68065a61d0fc1d7969af19ecf2136ac9 (diff) | |
parent | 34b1d1174c2c7054c01cfa39d274421d80649386 (diff) |
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-17.1-caf-msm8998
This brings LA.UM.8.2.r1-07400-sdm660.0 up to date with
https://android.googlesource.com/kernel/common/ android-4.4-p at commit:
34b1d1174c2c7 UPSTREAM: arm64: kaslr: Fix up the kernel image alignment
Conflicts:
scripts/setlocalversion
Change-Id: Id2981587a6e92eb10cfdc9b6d13cd4bd2abb5670
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 29d80146eb8a..78bd960c3527 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4179,6 +4179,36 @@ static inline int propagate_entity_load_avg(struct sched_entity *se) return 1; } +/* + * Check if we need to update the load and the utilization of a blocked + * group_entity: + */ +static inline bool skip_blocked_update(struct sched_entity *se) +{ + struct cfs_rq *gcfs_rq = group_cfs_rq(se); + + /* + * If sched_entity still have not zero load or utilization, we have to + * decay it: + */ + if (se->avg.load_avg || se->avg.util_avg) + return false; + + /* + * If there is a pending propagation, we have to update the load and + * the utilization of the sched_entity: + */ + if (gcfs_rq->propagate_avg) + return false; + + /* + * Otherwise, the load and the utilization of the sched_entity is + * already zero and there is no pending propagation, so it will be a + * waste of time to try to decay it: + */ + return true; +} + #else /* CONFIG_FAIR_GROUP_SCHED */ static inline void update_tg_load_avg(struct cfs_rq *cfs_rq, int force) {} @@ -9033,6 +9063,8 @@ static void update_blocked_averages(int cpu) * list_add_leaf_cfs_rq() for details. */ for_each_leaf_cfs_rq(rq, cfs_rq) { + struct sched_entity *se; + /* throttled entities do not contribute to load */ if (throttled_hierarchy(cfs_rq)) continue; @@ -9041,9 +9073,10 @@ static void update_blocked_averages(int cpu) true)) update_tg_load_avg(cfs_rq, 0); - /* Propagate pending load changes to the parent */ - if (cfs_rq->tg->se[cpu]) - update_load_avg(cfs_rq->tg->se[cpu], 0); + /* Propagate pending load changes to the parent, if any: */ + se = cfs_rq->tg->se[cpu]; + if (se && !skip_blocked_update(se)) + update_load_avg(se, 0); } raw_spin_unlock_irqrestore(&rq->lock, flags); } |