All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/cpuidle: don't count C1 multiple times
@ 2014-11-24 11:47 Jan Beulich
  2014-11-24 16:36 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2014-11-24 11:47 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

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 <jbeulich@suse.com>

--- 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;
 }




[-- Attachment #2: x86-count-C1-once.patch --]
[-- Type: text/plain, Size: 752 bytes --]

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 <jbeulich@suse.com>

--- 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;
 }

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/cpuidle: don't count C1 multiple times
  2014-11-24 11:47 [PATCH] x86/cpuidle: don't count C1 multiple times Jan Beulich
@ 2014-11-24 16:36 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 2+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-11-24 16:36 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On Mon, Nov 24, 2014 at 11:47:28AM +0000, 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 <konrad.wilk@oracle.com>
Reported-by: Steve Freitas <sflist@ihonk.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
(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 <jbeulich@suse.com>
> 
> --- 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 <jbeulich@suse.com>
> 
> --- 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;
>  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-24 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 11:47 [PATCH] x86/cpuidle: don't count C1 multiple times Jan Beulich
2014-11-24 16:36 ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.