summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2015-02-23 15:24:16 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2016-12-14 13:41:54 +0900
commit79850af1eae6c30630e11b7a7e2ecaffd7519307 (patch)
tree0855c763d79e6535677f031236db43bb2a2eea8e /kernel
parentc23c68b12997dcfa6eea6f039e5772b4a10fb891 (diff)
sched: reset blocked load decay_count during synchronization
If an entity happens to sleep for less than one tick duration the tracked load associated with that entity can be decayed by an unexpectedly large amount if it is later migrated to a different CPU. This can interfere with correct scheduling when entity load is used for decision making. The reason for this is that when an entity is dequeued and enqueued quickly, such that se.avg.decay_count and cfs_rq.decay_counter do not differ when that entity is enqueued again, __synchronize_entity_decay skips the calculation step and also skips clearing the decay_count. At a later time that entity may be migrated and its load will be decayed incorrectly. All users of this function expect decay_count to be zero'ed after use. Signed-off-by: Chris Redpath <chris.redpath@arm.com> Signed-off-by: Jon Medhurst <tixy@linaro.org> [k.kozlowski: rebased on 4.1, no signed-off-by of previous committer] Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f0bc3bfb1c2e..22598f9f9891 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2756,10 +2756,8 @@ static inline u64 __synchronize_entity_decay(struct sched_entity *se)
decays -= se->avg.decay_count;
se->avg.decay_count = 0;
- if (!decays)
- return 0;
-
- se->avg.load_avg_contrib = decay_load(se->avg.load_avg_contrib, decays);
+ if (decays)
+ se->avg.load_avg_contrib = decay_load(se->avg.load_avg_contrib, decays);
se->avg.utilization_avg_contrib =
decay_load(se->avg.utilization_avg_contrib, decays);
@@ -5435,7 +5433,7 @@ static ssize_t hmp_print_domains(char *outbuf, int outbufsize)
int outpos = 0;
list_for_each(pos, &hmp_domains) {
domain = list_entry(pos, struct hmp_domain, hmp_domains);
- if (cpumask_scnprintf(buf, 64, &domain->possible_cpus)) {
+ if (scnprintf(buf, 64, "%*pb", cpumask_pr_args(&domain->possible_cpus))) {
outpos += sprintf(outbuf+outpos, fmt, buf);
fmt = space;
}