From: "Dan Magenheimer" Subject: [PATCH] warn if time calibration goes wacko (was RE: Xen 3.2.2 - Timer ISR/0: Time went backwards) Date: Wed, 6 Aug 2008 10:27:12 -0600 Message-ID: <20080806102712343.00000008444@djm-pc> References: <20080806094658546.00000008444@djm-pc> Reply-To: "dan.magenheimer@oracle.com" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=-------521730d2521730d2 Return-path: In-Reply-To: <20080806094658546.00000008444@djm-pc> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "dan.magenheimer@oracle.com" , Jan Beulich , "Christopher S. Aker" , Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format ---------521730d2521730d2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable See below. Bad things will happen if these situations happen, so at least we can diagnose it easier. > -----Original Message----- > From: Dan Magenheimer [mailto:dan.magenheimer@oracle.com] > Sent: Wednesday, August 06, 2008 9:47 AM > To: 'Jan Beulich'; 'Christopher S. Aker'; 'Keir Fraser' > Cc: 'xen-devel@lists.xensource.com' > Subject: RE: [Xen-devel] Xen 3.2.2 - Timer ISR/0: Time went backwards > = > = > > 20-50+% timer interrupts. The moment this rate exceeds about 50%, > > platform time calibration breaks (as it sets the timer to = > > half the overflow period). = > = > I've looked at that code in local_time_calibration() a few times > and even added debug code once to see if it occurs. It > didn't on my machine, but I can see how it would cause problems > if it did happen. > = > Keir, would you accept a patch (or just add the two lines yourself) > to printk a warning if that "goto out" ever occurs and/or maybe > if the "scale factor is clamped"? > = > (Chris, this might not be your problem so apologies for the topic > drift, but if the printk had been there awhile ago, we'd at least > know if it is or is not the problem.) > = > Dan > = > P.S. This is also what led to the separate thread about measuring > interrupt latency. If this problem is due to huge periods with > interrupts off, it would be nice to know. > = > > -----Original Message----- > > From: xen-devel-bounces@lists.xensource.com > > [mailto:xen-devel-bounces@lists.xensource.com]On Behalf Of = > Jan Beulich > > Sent: Tuesday, August 05, 2008 1:04 AM > > To: Christopher S. Aker > > Cc: xen-devel@lists.xensource.com > > Subject: Re: [Xen-devel] Xen 3.2.2 - Timer ISR/0: Time went = > backwards > > = > > = > > This looks very similar to bug report we've got from IBM = > I'm currently > > trying to research (difficult, as I can't touch the = > > hardware). What I know > > so far is that we're losing, starting a few seconds after = > > dom0 boot began, > > 20-50+% timer interrupts. The moment this rate exceeds about 50%, > > platform time calibration breaks (as it sets the timer to = > > half the overflow > > period). Since jiffies aren't used much elsewhere, this loss = > > of timer ticks > > doesn't seem to matter much elsewhere. > > = > > I've got no real clue so far *why* there's such a high rate = > > of lost interrupts, > > though. The only (albeit small, since appearing very = > > unlikely) possibility > > would be frequent and extensive SMM entries after ACPI mode got > > enabled on the system. > > = > > Btw., does -unstable exhibit the same behavior? > > = > > Jan > > = > > >>> "Christopher S. Aker" 04.08.08 20:51 >>> > > Hardware: > > Xen: 3.2.1-rc2 64bit > > dom0: 2.6.18.8 at changeset 622, PAE > > = > > # xm dmesg | grep -e sync -e timer > > (XEN) checking TSC synchronization across 8 CPUs: passed. > > (XEN) Platform timer overflows in 234 jiffies. > > (XEN) Platform timer is 3.579MHz ACPI PM Timer > > (XEN) Machine check exception polling timer started. > > = > > Spools one of these to console every few seconds: > > = > > Timer ISR/0: Time went backwards: delta=3D-4270576170971 = > > delta_cpu=3D254829029 shadow=3D2037844042151244163 off=3D261710497 = > > processed=3D2037848312989081849 cpu_processed=3D2037844042158081849 > > 0: 2037844042158081849 > > 1: 2037828468354081849 > > 2: 2037848312989081849 > > 3: 2037837726866081849 > > 4: 2037842059197081849 > > 5: 2037840075526081849 > > 6: 2037845844663081849 > > 7: 2037841593777081849 > > = > > A few t's into Xen's console: > > = > > (XEN) *** Serial input -> Xen (type 'CTRL-a' three times to = > > switch input = > > to DOM0) > > (XEN) Min =3D 2037829427350793281 ; Max =3D 2037848310626701146 = > ; Diff =3D = > > 18883275907865 (18883275907 microseconds) > > (XEN) Min =3D 2037829428349256182 ; Max =3D 2037848311625163843 = > ; Diff =3D = > > 18883275907661 (18883275907 microseconds) > > (XEN) Min =3D 2037829428565188930 ; Max =3D 2037848311841096807 = > ; Diff =3D = > > 18883275907877 (18883275907 microseconds) > > = > > This particular box does this with 3.2.0 - 3.2.2-rc2. I = > have another = > > box doing the same thing, except the delta is more sane (0 - 2 = > > microseconds), however eventually dom0 freezes. > > = > > -Chris > > = > > = > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com = > > http://lists.xensource.com/xen-devel > > = > > = > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > ---------521730d2521730d2 Content-Type: application/octet-stream; name="timewarn.patch" Content-Disposition: attachment; filename="timewarn.patch" Content-Transfer-Encoding: base64 ZGlmZiAtciBmMjBmYjgzZGFjMmMgeGVuL2FyY2gveDg2L3RpbWUuYwotLS0gYS94ZW4vYXJj aC94ODYvdGltZS5jCVR1ZSBBdWcgMDUgMTM6NTU6MTQgMjAwOCArMDEwMAorKysgYi94ZW4v YXJjaC94ODYvdGltZS5jCVdlZCBBdWcgMDYgMTA6MjQ6MTMgMjAwOCAtMDYwMApAQCAtOTA5 LDcgKzkwOSwxMCBAQCBzdGF0aWMgdm9pZCBsb2NhbF90aW1lX2NhbGlicmF0aW9uKHZvaWQg CiAgICAgICogV2UgY291bGQgYmUgc21hcnRlciBoZXJlOiByZXN5bmMgcGxhdGZvcm0gdGlt ZXIgd2l0aCBsb2NhbCB0aW1lcj8KICAgICAgKi8KICAgICBpZiAoICgoczY0KXN0aW1lX2Vs YXBzZWQ2NCA8IChFUE9DSCAvIDIpKSApCisgICAgeworICAgICAgICBwcmludGsoIldBUk5J Tkc6IGxvY2FsIHRpbWUgbG9zdCBzeW5jIHdpdGggcGxhdGZvcm0gdGltZXJcbiIpOwogICAg ICAgICBnb3RvIG91dDsKKyAgICB9CiAKICAgICAvKgogICAgICAqIENhbGN1bGF0ZSBlcnJv ci1jb3JyZWN0aW9uIGZhY3Rvci4gVGhpcyBvbmx5IHNsb3dzIGRvd24gYSBmYXN0IGxvY2Fs CkBAIC05MjAsNyArOTIzLDEwIEBAIHN0YXRpYyB2b2lkIGxvY2FsX3RpbWVfY2FsaWJyYXRp b24odm9pZCAKICAgICB7CiAgICAgICAgIGxvY2FsX3N0aW1lX2VyciA9IGN1cnJfbG9jYWxf c3RpbWUgLSBjdXJyX21hc3Rlcl9zdGltZTsKICAgICAgICAgaWYgKCBsb2NhbF9zdGltZV9l cnIgPiBFUE9DSCApCisgICAgICAgIHsKKyAgICAgICAgICAgIHByaW50aygiV0FSTklORzog c2NhbGUgZmFjdG9yIGNsYW1wZWQgaW4gbG9jYWwgdGltZSBjYWxpYnJhdGlvblxuIik7CiAg ICAgICAgICAgICBsb2NhbF9zdGltZV9lcnIgPSBFUE9DSDsKKyAgICAgICAgfQogICAgICAg ICBlcnJvcl9mYWN0b3IgPSBkaXZfZnJhYyhFUE9DSCwgRVBPQ0ggKyAodTMyKWxvY2FsX3N0 aW1lX2Vycik7CiAgICAgfQogCg== ---------521730d2521730d2 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.xensource.com http://lists.xensource.com/xen-devel ---------521730d2521730d2--