From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] x86/cpuidle: don't count C1 multiple times Date: Mon, 24 Nov 2014 11:36:22 -0500 Message-ID: <20141124163622.GA7449@laptop.dumpdata.com> References: <547328E0020000780004A4A1@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xswcl-0003z0-UI for xen-devel@lists.xenproject.org; Mon, 24 Nov 2014 16:36:28 +0000 Content-Disposition: inline In-Reply-To: <547328E0020000780004A4A1@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org 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 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; > }