Re: [Xen-devel] [PATCH] x86/cpuidle: don't count C1 multiple times

2014-11-24 Thread Konrad Rzeszutek Wilk
On Mon, Nov 24, 2014 at 11:47:28AM +, Jan Beulich wrote:
> Commit 4ca6f9f0 ("x86/cpuidle: publish new states only after fully
> initializing them") resulted in the state counter to be incremented
> for C1 despite that using a fixed table entry (and the statically
> initialized counter value already accounting for it and C0).
> 

Reviewed-by: Konrad Rzeszutek Wilk 
Reported-by: Steve Freitas 
Release-Acked-by: Konrad Rzeszutek Wilk 
(thought it would be good to get from Steve an confirmation that this
fixes it - which I believe is 99% the case).

> Signed-off-by: Jan Beulich 
> 
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -1015,7 +1015,7 @@ static void set_cx(
>  cx->target_residency = cx->latency * latency_factor;
>  
>  smp_wmb();
> -acpi_power->count++;
> +acpi_power->count += (cx->type != ACPI_STATE_C1);
>  if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
>  acpi_power->safe_state = cx;
>  }
> 
> 
> 

> x86/cpuidle: don't count C1 multiple times
> 
> Commit 4ca6f9f0 ("x86/cpuidle: publish new states only after fully
> initializing them") resulted in the state counter to be incremented
> for C1 despite that using a fixed table entry (and the statically
> initialized counter value already accounting for it and C0).
> 
> Signed-off-by: Jan Beulich 
> 
> --- a/xen/arch/x86/acpi/cpu_idle.c
> +++ b/xen/arch/x86/acpi/cpu_idle.c
> @@ -1015,7 +1015,7 @@ static void set_cx(
>  cx->target_residency = cx->latency * latency_factor;
>  
>  smp_wmb();
> -acpi_power->count++;
> +acpi_power->count += (cx->type != ACPI_STATE_C1);
>  if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
>  acpi_power->safe_state = cx;
>  }


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


[Xen-devel] [PATCH] x86/cpuidle: don't count C1 multiple times

2014-11-24 Thread Jan Beulich
Commit 4ca6f9f0 ("x86/cpuidle: publish new states only after fully
initializing them") resulted in the state counter to be incremented
for C1 despite that using a fixed table entry (and the statically
initialized counter value already accounting for it and C0).

Signed-off-by: Jan Beulich 

--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1015,7 +1015,7 @@ static void set_cx(
 cx->target_residency = cx->latency * latency_factor;
 
 smp_wmb();
-acpi_power->count++;
+acpi_power->count += (cx->type != ACPI_STATE_C1);
 if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
 acpi_power->safe_state = cx;
 }



x86/cpuidle: don't count C1 multiple times

Commit 4ca6f9f0 ("x86/cpuidle: publish new states only after fully
initializing them") resulted in the state counter to be incremented
for C1 despite that using a fixed table entry (and the statically
initialized counter value already accounting for it and C0).

Signed-off-by: Jan Beulich 

--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -1015,7 +1015,7 @@ static void set_cx(
 cx->target_residency = cx->latency * latency_factor;
 
 smp_wmb();
-acpi_power->count++;
+acpi_power->count += (cx->type != ACPI_STATE_C1);
 if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
 acpi_power->safe_state = cx;
 }
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel