summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fernandes <joelaf@google.com>2017-08-18 13:29:46 -0700
committerGeorg Veichtlbauer <georg@vware.at>2023-07-16 13:06:30 +0200
commit891a63210e1d65ed226050ce7921dcec210a671a (patch)
tree830242d5e96634c336351b723c9d0dd27f5ca18a
parentb775cb29f66382f04ba4c1e7ad385081a020269b (diff)
sched/fair: Fix issue where frequency update not skipped
This patch fixes one of the infrequent conditions in commit 54b6baeca500 ("sched/fair: Skip frequency updates if CPU about to idle") where we could have skipped a frequency update. The fix is to use the correct flag which skips freq updates. Note that this is a rare issue (can show up only during CFS throttling) and even then we just do an additional frequency update which we were doing anyway before the above patch. Bug: 64689959 Change-Id: I0117442f395cea932ad56617065151bdeb9a3b53 Signed-off-by: Joel Fernandes <joelaf@google.com>
-rw-r--r--kernel/sched/fair.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ef6046d3a016..2015cf048a44 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4529,7 +4529,7 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq, bool update_freq)
#define UPDATE_TG 0x0
#define SKIP_AGE_LOAD 0x0
-#define SKIP_CPUFREQ 0x3
+#define SKIP_CPUFREQ 0x0
static inline void update_load_avg(struct sched_entity *se, int not_used1){}
static inline void
@@ -6092,6 +6092,8 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
}
for_each_sched_entity(se) {
+ int update_flags;
+
cfs_rq = cfs_rq_of(se);
cfs_rq->h_nr_running--;
walt_dec_cfs_cumulative_runnable_avg(cfs_rq, p);
@@ -6100,7 +6102,12 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
if (cfs_rq_throttled(cfs_rq))
break;
- update_load_avg(se, UPDATE_TG | (flags & DEQUEUE_IDLE));
+ update_flags = UPDATE_TG;
+
+ if (flags & DEQUEUE_IDLE)
+ update_flags |= SKIP_CPUFREQ;
+
+ update_load_avg(se, update_flags);
update_cfs_shares(se);
}