diff mbox

cpufreq: governors: Fix calculation of wall time in get_cpu_idle_time

Message ID 514C0555.1010806@semaphore.gr (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Stratos Karafotis March 22, 2013, 7:16 a.m. UTC
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.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
---
 drivers/cpufreq/cpufreq_governor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar March 22, 2013, 11:39 a.m. UTC | #1
On Fri, Mar 22, 2013 at 12:46 PM, Stratos Karafotis
<stratosk@semaphore.gr> wrote:
> 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.
>
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
> ---
>  drivers/cpufreq/cpufreq_governor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> index b49d45d..41e5e56 100644
> --- a/drivers/cpufreq/cpufreq_governor.c
> +++ b/drivers/cpufreq/cpufreq_governor.c
> @@ -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);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael Wysocki March 22, 2013, 1:24 p.m. UTC | #2
On Friday, March 22, 2013 09:16:37 AM Stratos Karafotis wrote:
> 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.
> 
> Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>

I folded the change below into the original patch.

Thanks,
Rafael


> ---
>  drivers/cpufreq/cpufreq_governor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> index b49d45d..41e5e56 100644
> --- a/drivers/cpufreq/cpufreq_governor.c
> +++ b/drivers/cpufreq/cpufreq_governor.c
> @@ -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);
>
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index b49d45d..41e5e56 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -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);