cpufreq: governors: Fix calculation of wall time in get_cpu_idle_time
PATCH 1/1 cpufreq: governors: Fix calculation of wall time in get_cpu_idle_time
With commit 8755a8ae31ba213db196324011a0da2a85807f25 the wall in get_cpu_idle_time is not calculated, when we use ondemand with io_is_busy = 1, preventing the CPU to increase to max frequency.
Properly, calculate wall time when we use io_is_busy.
--- drivers/cpufreq/cpufreq_governor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq_governor.c +1 -1
@@ -53,7 +53,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)u64 get_cpu_idle_time (unsigned int cpu,u64 *wall,int io_busy) { -u64 idle_time =get_cpu_idle_time_us (cpu,NULL ); +u64 idle_time =get_cpu_idle_time_us (cpu, io_busy ? wall :NULL );if (idle_time ==-1ULL )return get_cpu_idle_time_jiffy (cpu, wall);
Signature · 1 line
1.8.1.4
Quoted 16 lines · Stratos Karafotis
With commit
8755a8ae31ba213db196324011a0da2a85807f25the wall inget_cpu_idle_timeis not calculated, when we use ondemand withio_is_busy= 1, preventing the CPU to increase to max frequency.Properly, calculate wall time when we use
io_is_busy.Signed-off-by Stratos Karafotis <[email protected]>--- drivers/cpufreq/cpufreq_governor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/cpufreq_governor.c +0
-0
drivers/cpufreq/cpufreq_governor.c static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall) · line 59
Quoted 8 lines
drivers/cpufreq/cpufreq_governor.c +1
-1@@ -53,7 +53,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)u64 get_cpu_idle_time (unsigned int cpu,u64 *wall,int io_busy) { -u64 idle_time =get_cpu_idle_time_us (cpu,NULL ); +u64 idle_time =get_cpu_idle_time_us (cpu, io_busy ? wall :NULL );if (idle_time ==-1ULL )return get_cpu_idle_time_jiffy (cpu, wall);
Quoted 7 lines · Stratos Karafotis
With commit
8755a8ae31ba213db196324011a0da2a85807f25the wall inget_cpu_idle_timeis not calculated, when we use ondemand withio_is_busy= 1, preventing the CPU to increase to max frequency.Properly, calculate wall time when we use
io_is_busy.Signed-off-by Stratos Karafotis <[email protected]>
I folded the change below into the original patch.
Thanks,
Rafael
Quoted 18 lines
--- drivers/cpufreq/cpufreq_governor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/cpufreq_governor.c +1
-1@@ -53,7 +53,7 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)u64 get_cpu_idle_time (unsigned int cpu,u64 *wall,int io_busy) { -u64 idle_time =get_cpu_idle_time_us (cpu,NULL ); +u64 idle_time =get_cpu_idle_time_us (cpu, io_busy ? wall :NULL );if (idle_time ==-1ULL )return get_cpu_idle_time_jiffy (cpu, wall);
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.