]> Git Repo - linux.git/commitdiff
sched: Move update_other_load_avgs() to kernel/sched/pelt.c
authorTejun Heo <[email protected]>
Wed, 11 Sep 2024 19:36:43 +0000 (09:36 -1000)
committerTejun Heo <[email protected]>
Thu, 12 Sep 2024 06:00:21 +0000 (20:00 -1000)
96fd6c65efc6 ("sched: Factor out update_other_load_avgs() from
__update_blocked_others()") added update_other_load_avgs() in
kernel/sched/syscalls.c right above effective_cpu_util(). This location
didn't fit that well in the first place, and with 5d871a63997f ("sched/fair:
Move effective_cpu_util() and effective_cpu_util() in fair.c") moving
effective_cpu_util() to kernel/sched/fair.c, it looks even more out of
place.

Relocate the function to kernel/sched/pelt.c where all its callees are.

No functional changes.

Signed-off-by: Tejun Heo <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
kernel/sched/pelt.c
kernel/sched/pelt.h
kernel/sched/sched.h
kernel/sched/syscalls.c

index fa52906a4478cc4adb677599b1f00023380ae26c..a9c65d97b3cac61c6203b345ae47a791dc3dddc3 100644 (file)
@@ -467,3 +467,23 @@ int update_irq_load_avg(struct rq *rq, u64 running)
        return ret;
 }
 #endif
+
+/*
+ * Load avg and utiliztion metrics need to be updated periodically and before
+ * consumption. This function updates the metrics for all subsystems except for
+ * the fair class. @rq must be locked and have its clock updated.
+ */
+bool update_other_load_avgs(struct rq *rq)
+{
+       u64 now = rq_clock_pelt(rq);
+       const struct sched_class *curr_class = rq->curr->sched_class;
+       unsigned long hw_pressure = arch_scale_hw_pressure(cpu_of(rq));
+
+       lockdep_assert_rq_held(rq);
+
+       /* hw_pressure doesn't care about invariance */
+       return update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) |
+               update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) |
+               update_hw_load_avg(rq_clock_task(rq), rq, hw_pressure) |
+               update_irq_load_avg(rq, 0);
+}
index 2150062949d43fc9c246d75e972f60fa62bec688..f4f6a0875c66fb7a9d74ead3fc0b6226253b7fc4 100644 (file)
@@ -6,6 +6,7 @@ int __update_load_avg_se(u64 now, struct cfs_rq *cfs_rq, struct sched_entity *se
 int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq);
 int update_rt_rq_load_avg(u64 now, struct rq *rq, int running);
 int update_dl_rq_load_avg(u64 now, struct rq *rq, int running);
+bool update_other_load_avgs(struct rq *rq);
 
 #ifdef CONFIG_SCHED_HW_PRESSURE
 int update_hw_load_avg(u64 now, struct rq *rq, u64 capacity);
index 07a2f523e2ebb3ceccb3af379dbd7b825e2634b7..8063db62b02742cf59a47c9cf9476e0a313cdbab 100644 (file)
@@ -3245,8 +3245,6 @@ static inline void cpufreq_update_util(struct rq *rq, unsigned int flags) { }
 
 #ifdef CONFIG_SMP
 
-bool update_other_load_avgs(struct rq *rq);
-
 unsigned long effective_cpu_util(int cpu, unsigned long util_cfs,
                                 unsigned long *min,
                                 unsigned long *max);
index b621e0050e4265255afa844fed46ad6dc353ef13..ddf6e6c82f0228da8ac46975f452cbc82db55ffb 100644 (file)
@@ -258,28 +258,6 @@ int sched_core_idle_cpu(int cpu)
 
 #endif
 
-#ifdef CONFIG_SMP
-/*
- * Load avg and utiliztion metrics need to be updated periodically and before
- * consumption. This function updates the metrics for all subsystems except for
- * the fair class. @rq must be locked and have its clock updated.
- */
-bool update_other_load_avgs(struct rq *rq)
-{
-       u64 now = rq_clock_pelt(rq);
-       const struct sched_class *curr_class = rq->curr->sched_class;
-       unsigned long hw_pressure = arch_scale_hw_pressure(cpu_of(rq));
-
-       lockdep_assert_rq_held(rq);
-
-       /* hw_pressure doesn't care about invariance */
-       return update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) |
-               update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) |
-               update_hw_load_avg(rq_clock_task(rq), rq, hw_pressure) |
-               update_irq_load_avg(rq, 0);
-}
-#endif /* CONFIG_SMP */
-
 /**
  * find_process_by_pid - find a process with a matching PID value.
  * @pid: the pid in question.
This page took 0.069135 seconds and 4 git commands to generate.