mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	LKML <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Alok Kataria <akataria@vmware.com>, Michael Buesch <mb@bu3sch.de>
Subject: Re: Regression in 2.6.27 caused by commit bfc0f59
Date: Mon, 1 Sep 2008 22:07:33 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0809012114050.3243@apollo.tec.linutronix.de> (raw)
In-Reply-To: <alpine.LFD.1.10.0809011142520.12958@nehalem.linux-foundation.org>

On Mon, 1 Sep 2008, Linus Torvalds wrote:
> On Mon, 1 Sep 2008, Thomas Gleixner wrote:
> > 
> > Hmm. Haven't seen that before, but if confirms what I guessed from
> > your previous dmesg information. I wonder why you did not observe
> > strange behaviour with older kernel versions.
> 
> x86-32 never used the PM_TIMER for frequency estimation, it only ever used 
> the PIT. See the old "native_calculate_cpu_khz()" in tsc_32.c that you 
> deleted in favor of the (imho inferior) x86-64 version.
> 
> How about:
> 
>  - taking the old 32-bit code, and using it to initially _just_ estimate 
>    the TSC speed. That code was stable and pretty much guaranteed to work 
>    reasonably well on all machines. It retries the timings three times, 
>    and picks the best one.
> 
>  - Then, _after_ you already have a pretty good estimation for TSC, you 
>    can use _that_ to then get the HPET and/or PM_TIMER version (and not 
>    use the PIT at all for those calibrations)
> 
>  - and if the PM_TIMER one is too far off, just throw it away. We know the 
>    PIT is a lot more trustworthy than the PM_TIMER.

Far off in which direction ?

If the PIT interrupts are delayed by SMM code, then I see That's on a
max. three years old 32bit Core Duo things like:

[    0.000000] Detected 8340.258 MHz processor.
[   13.782091] APIC calibration not consistent with PM Timer: 228ms instead of 100ms

This one is way off, while the next one is in a reasonable range

[    0.000000] Detected 3240.001 MHz processor.
[   13.792122] APIC calibration not consistent with PM Timer: 178ms instead of 100ms

while in reality the machine is @2GHZ and current mainline says:

[    0.000000] Detected 2000.065 MHz processor.

The CPU calibration of < 2.6.27 is against PIT and does _NOT_ give me a
pretty good estimation for TSC.

I was pretty happy when Alok beat me to unify the TSC calibration code
as it solved one of my long standing todo items, which also filled my
buglist on a regular base.

I did debugged this thorougly using the tracer from preempt-rt to
check, what the box does during that time, and it definitely vanishes
for >100ms in a row in the black hole of the stupid BIOS.


So either way. Relying on PIT on newer machines is _BAD_, relying on
PM_TIMER on older machine is _BAD_ as well.

There is no given good estimate, when the TSC/PIT calibration is off
by factor 1.5 to 4. The consequence would be that I throw away a
perfect fine pmtimer and run a machine which advertises itself as the
fastest box on the planet. With your method I would disable nohz and I
would be back to 50% battery time.

I'm happy to discard the PIT on the 32bit machines again and then file
a bugreport for a regression between 2.6.27-rc1 and tomorrows git :)

This one is the first complaints, I've seen vs. a non working pmtimer
since quite a time. That's why I obviously forgot about the rate check
issue.

I just looked at drivers/clocksource/acpi_pm.c history and saw, that
John explicitely mentions AMD K6 in commit
562f9c574e0707f9159a729ea41faf53b221cd30

    This patch re-adds the verify_pmtmr_rate functionality from 2.6.17 that
    I dropped 2.6.18.
    
    This resolves problems seen on older K6 ASUS boards where the ACPI PM
    timer runs too fast.

Larry's box has: "an AMD-K6 at stepping 0c and running at 450 MHz."

The oracle of google only gave me hits for AMD-K6 in a quick survey
along with the slow access mode problem for older ICH4 chipsets.

So I think it's a reasonable thing to disable the PMTIMER based
calibration on AMD-K6 and older. I'm not sure about the exact cut line
we choose - it might be wrong as always, but it's definitely better
than adding a lot of magic into the calibration code.

Thanks,

	tglx

  reply	other threads:[~2008-09-01 20:07 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-31 22:54 Larry Finger
2008-09-01 11:14 ` Thomas Gleixner
2008-09-01 15:37   ` Larry Finger
2008-09-01 17:49     ` Thomas Gleixner
2008-09-01 17:44   ` Larry Finger
2008-09-01 18:31     ` Thomas Gleixner
2008-09-01 19:10       ` Linus Torvalds
2008-09-01 20:07         ` Thomas Gleixner [this message]
2008-09-01 21:30           ` Thomas Gleixner
2008-09-01 22:02           ` Linus Torvalds
2008-09-01 22:33             ` Thomas Gleixner
2008-09-01 22:56               ` Linus Torvalds
2008-09-01 23:24                 ` Thomas Gleixner
2008-09-02  6:37                   ` Andi Kleen
2008-09-02 12:21                     ` Thomas Gleixner
2008-09-01 22:16           ` Linus Torvalds
2008-09-01 23:16             ` Thomas Gleixner
2008-09-02  3:18               ` Linus Torvalds
2008-09-02  3:35                 ` Linus Torvalds
2008-09-02  4:54                   ` Larry Finger
2008-09-02  9:17                   ` Alan Cox
2008-09-02 12:15                   ` Thomas Gleixner
2008-09-02 15:09                     ` Linus Torvalds
2008-09-02 18:14                       ` Thomas Gleixner
2008-09-02 18:41                         ` Alok Kataria
2008-09-02 21:16                           ` Thomas Gleixner
2008-09-02 18:42                         ` Linus Torvalds
2008-09-02 21:13                           ` Thomas Gleixner
2008-09-02 22:21                             ` Linus Torvalds
2008-09-02 23:10                               ` Thomas Gleixner
2008-09-03  1:49                                 ` Linus Torvalds
2008-09-02 22:54                           ` [PATCH] Fix TSC calibration issues Thomas Gleixner
2008-09-03  2:14                             ` Linus Torvalds
2008-09-03  9:11                               ` Thomas Gleixner
2008-09-04  1:14                                 ` Alok Kataria
2008-09-04  2:56                                   ` Linus Torvalds
2008-09-04  3:16                                     ` Arjan van de Ven
2008-09-04  3:59                                       ` Linus Torvalds
2008-09-04  4:10                                         ` Arjan van de Ven
2008-09-04  4:20                                           ` Linus Torvalds
2008-09-04  4:27                                             ` Arjan van de Ven
2008-09-04  4:25                                         ` Willy Tarreau
2008-09-04  4:53                                           ` Linus Torvalds
2008-09-04  5:09                                             ` Willy Tarreau
2008-09-04  1:18                                 ` [PATCH] Change warning message in TSC calibration Alok Kataria
2008-09-03  2:51                             ` [PATCH] Fix TSC calibration issues Larry Finger
2008-09-03  4:00                               ` Linus Torvalds
2008-09-03  4:34                                 ` Larry Finger
2008-09-05 13:45                       ` Regression in 2.6.27 caused by commit bfc0f59 Mark Lord
2008-09-02 17:17                 ` Bill Davidsen
2008-09-01 19:36       ` Larry Finger
2008-09-01 20:09         ` Thomas Gleixner
2008-09-01 20:23           ` Larry Finger
2008-09-01 20:45             ` Thomas Gleixner
2008-09-01 18:42     ` Linus Torvalds
2008-09-01 19:08       ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0809012114050.3243@apollo.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=akataria@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome