From: "Jan Beulich" Subject: Re: Regression, host crash with 4.5rc1 Date: Mon, 24 Nov 2014 11:41:12 +0000 Message-ID: <54732768020000780004A48C@mail.emea.novell.com> References: <5457F79B.2020300@ihonk.com> <20141104082012.GY12451@reaktio.net> <5458B55C0200007800044B33@mail.emea.novell.com> <5460716A.7090905@ihonk.com> <54608A8B0200007800045E58@mail.emea.novell.com> <54611A86.4000200@ihonk.com> <5461D15C02000078000464D7@mail.emea.novell.com> <546A4AD4.3030002@ihonk.com> <546B094C0200007800048A5C@mail.emea.novell.com> <546D429A.5020906@ihonk.com> <546DAD6502000078000492FD@mail.emea.novell.com> <546E4A17.5040902@ihonk.com> <546F091F0200007800049A1C@smtp.nue.novell.com> <54713848.3020401@ihonk.com> <5472FE31020000780004A2D5@mail.emea.novell.com> <7637FB2C-D2F9-4F5A-B71F-6C444C7F1B71@ihonk.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1E2B3448.2__=" Return-path: In-Reply-To: <7637FB2C-D2F9-4F5A-B71F-6C444C7F1B71@ihonk.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: Steve Freitas Cc: Don Slutz , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1E2B3448.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> On 24.11.14 at 10:08, wrote: > On Nov 24, 2014, at 00:45, Jan Beulich wrote: >=20 >>>>> On 23.11.14 at 02:28, wrote: >>> With mwait-idle=3D0: >>>=20 >>> (XEN) 'c' pressed -> printing ACPI Cx structures >>> (XEN) =3D=3Dcpu0=3D=3D >>> (XEN) active state: C0 >>> (XEN) max_cstate: C7 >>> (XEN) states: >>> (XEN) C1: type[C1] latency[001] usage[00000000] method[ FFH]=20 >>> duration[0] >>> (XEN) C2: type[C0] latency[000] usage[00000000] method[ NONE]=20 >>> duration[0] >>> (XEN) C3: type[C3] latency[064] usage[00000000] method[ FFH]=20 >>> duration[0] >>> (XEN) C4: type[C3] latency[096] usage[00000000] method[ FFH]=20 >>> duration[0] >>> (XEN) *C0: usage[00000000] duration[46930624784] >>> (XEN) PC2[0] PC3[0] PC6[0] PC7[0] >>> (XEN) CC3[0] CC6[0] CC7[0] >>> [...] >>=20 >> Very interesting - the hypervisor has C-state information, but never >> entered any of them. That certainly explains the difference between >> using/not using the ,wait-idle driver, but puts us back to there being >> a more general issue with C-state use on this CPU model. Possibly >> related to C2 having entry method "NONE", but then again I can't >> see how such a state could get entered into the table the first place: >> set_cx() bails upon check_cx() returning an error, and hence its >> switch()'s default statement should never be reached. Plus even if an >> array entry was set to "NONE", it should simply be ignored when >> looking for a state to enter. I'll probably need to put together a >> debugging patch to figure out what's going on here. >=20 > Okay, happy to give it a go whenever you have the time to put = something=20 > together. While putting this together I found the reason for the strange C2: line, and the attached debugging patch already has the fix for it (which I'll also submit separately, and hence you may need to drop that specific hunk should you end up applying it on a tree which already has that fix). You'll need to again run with "mwait-idle=3D0", and it's the boot messages along with the 'c' debug key output that's of interest. Thanks, Jan --=__Part1E2B3448.2__= Content-Type: text/plain; name="Freitas-Cx.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Freitas-Cx.patch" --- unstable.orig/xen/arch/x86/acpi/cpu_idle.c=0A+++ unstable/xen/arch/x86/= acpi/cpu_idle.c=0A@@ -58,7 +58,7 @@=0A #include =0A = #include =0A =0A-/*#define DEBUG_PM_CX*/=0A+#define DEBUG_PM_CX= =0A =0A #define GET_HW_RES_IN_NS(msr, val) \=0A do { rdmsrl(msr, val); = val =3D tsc_ticks2ns(val); } while( 0 )=0A@@ -238,6 +238,9 @@ static char* = acpi_cstate_method_name[] =3D=0A "HALT"=0A };=0A =0A+struct reasons { = unsigned long max, pwr, urg, nxt; };//temp=0A+static DEFINE_PER_CPU(struct = reasons, reasons);//temp=0A+=0A static void print_acpi_power(uint32_t cpu, = struct acpi_processor_power *power)=0A {=0A uint32_t i, idle_usage =3D = 0;=0A@@ -273,6 +276,8 @@ static void print_acpi_power(uint32_t cp=0A = printk((last_state_idx =3D=3D 0) ? " *" : " ");=0A printk("C0:\tus= age[%08d] duration[%"PRId64"]\n",=0A idle_usage, NOW() - = idle_res);=0A+printk("max=3D%lx pwr=3D%lx urg=3D%lx nxt=3D%lx\n",//temp=0A+= per_cpu(reasons.max, cpu), per_cpu(reasons.pwr, cpu), per_cpu(reason= s.urg, cpu), per_cpu(reasons.nxt, cpu));=0A =0A print_hw_residencies(cp= u);=0A }=0A@@ -501,6 +506,7 @@ static void acpi_processor_idle(void)=0A = u32 exp =3D 0, pred =3D 0;=0A u32 irq_traced[4] =3D { 0 };=0A = =0A+next_state =3D 1;//temp=0A if ( max_cstate > 0 && power && = !sched_has_urgent_vcpu() &&=0A (next_state =3D cpuidle_current_gov= ernor->select(power)) > 0 )=0A {=0A@@ -519,6 +525,10 @@ static void = acpi_processor_idle(void)=0A }=0A if ( !cx )=0A {=0A+this_cpu(r= easons.max) +=3D max_cstate <=3D 0;//temp=0A+this_cpu(reasons.pwr) +=3D = !power;//temp=0A+this_cpu(reasons.urg) +=3D !!sched_has_urgent_vcpu();//tem= p=0A+this_cpu(reasons.nxt) +=3D next_state <=3D 0;//temp=0A if ( = pm_idle_save )=0A pm_idle_save();=0A else=0A@@ -1007,6 = +1017,7 @@ static void set_cx(=0A cx->entry_method =3D ACPI_CSTATE_= EM_SYSIO;=0A break;=0A default:=0A+printk("CPU%u: C%u space = %x?\n", acpi_power->cpu, xen_cx->type, xen_cx->reg.space_id);//temp=0A = cx->entry_method =3D ACPI_CSTATE_EM_NONE;=0A break;=0A = }=0A@@ -1015,7 +1026,7 @@ static void set_cx(=0A cx->target_residency = =3D cx->latency * latency_factor;=0A =0A smp_wmb();=0A- acpi_power->= count++;=0A+ acpi_power->count +=3D (cx->type !=3D ACPI_STATE_C1);=0A = if ( cx->type =3D=3D ACPI_STATE_C1 || cx->type =3D=3D ACPI_STATE_C2 )=0A = acpi_power->safe_state =3D cx;=0A }=0A@@ -1141,6 +1152,7 @@ long = set_cx_pminfo(uint32_t cpu, struct =0A =0A /* FIXME: C-state dependency= is not supported by far */=0A =0A+printk("CPU%u: %pS, %pS\n", cpu, = pm_idle_save, pm_idle);//temp=0A if ( cpu_id =3D=3D 0 )=0A {=0A = if ( pm_idle_save =3D=3D NULL )=0A --=__Part1E2B3448.2__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part1E2B3448.2__=--