diff mbox series

cpufreq_times_record_transition() is not called when fast switch is enabled, leading /proc/[pid]/time_in_state to attribute all time on a cluster to a single frequency. To fix this, add a call to cpufreq_times_record_transition() in the fast switch path.

Message ID 1665386638-342822-1-git-send-email-hongchengwen@oppo.com
State New
Headers show
Series cpufreq_times_record_transition() is not called when fast switch is enabled, leading /proc/[pid]/time_in_state to attribute all time on a cluster to a single frequency. To fix this, add a call to cpufreq_times_record_transition() in the fast switch path. | expand

Commit Message

hongchengwen Oct. 10, 2022, 7:23 a.m. UTC
From: zhengding chen <chenzhengding@oppo.com>

Test: /proc/[pid]/time_in_state shows times for more than one freq per
cluster

Signed-off-by: zhengding chen <chenzhengding@oppo.com>
---
 drivers/cpufreq/cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

--
2.7.4
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 69b3d61..1caaf63 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2128,6 +2128,7 @@  unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
        arch_set_freq_scale(policy->related_cpus, freq,
                            policy->cpuinfo.max_freq);
        cpufreq_stats_record_transition(policy, freq);
+       cpufreq_times_record_transition(policy, freq);

        if (trace_cpu_frequency_enabled()) {
                for_each_cpu(cpu, policy->cpus)