Re: [PATCH] ACPI: Fix the incorrect calculation about C-state idle time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 1, 2010 at 8:04 PM,  <yakui.zhao@xxxxxxxxx> wrote:
> From: Zhao Yakui <yakui.zhao@xxxxxxxxx>
>
> The C-state idle time is not calculated correctly, which will return the wrong
> residency time in C-state. It will have the following effects:
>   1.  The system can't choose the deeper C-state when it is idle next time.
> Of course the system power is increased. E.g. On one server machine about 40W
> idle power is increased.
>   2.  The powertop shows that it will stay in C0 running state about 95% time
> although the system is idle at most time.

This was a bug from my recent patch here :-(
http://marc.info/?l=linux-acpi&m=127198016715509&w=2

Thanks for catching this..

Acked-by: Venkatesh Pallipadi <venki@xxxxxxxxxx>

>
> Signed-off-by: Zhao Yakui <yakui.zhao@xxxxxxxxx>
> Reported-by: Yu Zhidong <zhidong.yu@xxxxxxxxx>
> Tested-by: Yu Zhidong <zhidong.yu@xxxxxxxxx>
> CC: Venkatesh Pallipadi <venki@xxxxxxxxxx>
> ---
>  drivers/acpi/processor_idle.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 2e8c27d..6b38a6b 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1022,7 +1022,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
>                spin_unlock(&c3_lock);
>        }
>        kt2 = ktime_get_real();
> -       idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1));
> +       idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1));
>        idle_time = idle_time_ns;
>        do_div(idle_time, NSEC_PER_USEC);
>
> --
> 1.5.4.5
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux