public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jesper Krogh <jesper@krogh.cc>, john stultz <johnstul@us.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Len Brown <len.brown@intel.com>
Subject: Re: Linux 2.6.29-rc6
Date: Tue, 17 Mar 2009 17:40:51 +0100	[thread overview]
Message-ID: <20090317164051.GA32245@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.00.0903170919310.3082@localhost.localdomain>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Tue, 17 Mar 2009, Ingo Molnar wrote:
> > 
> > That's the idea of my patch: to use not two endpoints but thousands 
> > of measurement points.
> 
> Umm. Except you don't.
> 
> > By measuring more we can get a more precise result, and we also do 
> > not assume anything about how much time passes between two 
> > measurement points.
> 
> That's fine, but your actual code doesn't _do_ that.
> 
> > My 'delta' algorithm does not assume anything about how much time 
> > passes between two measurement points - it calculates the slope and 
> > keeps a rolling average of that slope.
> 
> No, you keep a very bad measure of "some kind of random average of the 
> last few points", which - if I read things right:
> 
>  - lacks precision (you really need to use 'double' floating point to do 
>    it well, otherwise the rounding errors will kill you). You seem to be 
>    aiming for a 10-bit fixed point thing, which may or may not work if 
>    done cleverly, but:
> 
>  - seems to be based on a rather weak averaging function which certainly 
>    will lose data over time.
> 
> The thing is, the only _accurate_ average is the one done over 
> long time distances. It's very true that your slope thing works 
> very well over such long times, and you'd get accurate measurement 
> if you did it that way, BUT THAT IS NOT WHAT YOU DO. You have a 
> very tight loop, so you get very bad slopes, and then you use a 
> weak averaging function to try to make them better, but it never 
> does.

Hm, the intention there was to have a memory of ~1000 entries via a 
decaying average of 1:1000.

In parallel to that there's also a noise estimator (which too decays 
over time). So basically when observed noise is very low we 
essentially use the data from the last ~1000 measurements. (well, 
not exactly - as the 'memory' of more recent data will be stronger 
than that of older ones.)

Again ... it's a clearly non-working patch so it's not really a 
defendable concept :-)

> Also, there seems to be a fundamental bug in your PIT reading 
> routine. My fast-TSC calibration only looks at the MSB of the PIT 
> read for a very good reason: if you don't use the explicit LATCH 
> command, you may be getting the MSB of one counter value, and then 
> the LSB of another. So your PIT read can easily be off by ~256 PIT 
> cycles. Only by caring only for the MSB can you do an unlatched 
> read!
> 
> That is why pit_expect_msb() looks for the "edge" where the MSB 
> changes, and never actually looks at the LSB.
> 
> This issue may be an additional reason for your problems, although 
> maybe your noise correction will be able to avoid those cases.

indeed. I did check the trace results though via gnuplot yesterday 
(suspectig PIT readout outliers) and there were no outliers.

For any final patch it's still a showstopper issue.

But the source of error and miscalibration is elsewhere.

	Ingo

  reply	other threads:[~2009-03-17 16:41 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23  4:31 Linux 2.6.29-rc6 Linus Torvalds
2009-02-23 14:07 ` Linux 2.6.29-rc6 - Fix oops in i915_gem_retire_requests Karsten Wiese
2009-02-26 11:15 ` Linux 2.6.29-rc6 Jesper Krogh
2009-02-26 17:17   ` MTD_CK804XROM warning (Was: Linux 2.6.29-rc6) Marcin Slusarz
2009-02-26 17:53   ` Linux 2.6.29-rc6 Linus Torvalds
2009-02-26 19:22     ` David Woodhouse
2009-02-26 19:31     ` Jesper Krogh
2009-02-26 19:36       ` David Woodhouse
2009-02-26 19:46         ` Jesper Krogh
2009-02-26 19:49           ` David Woodhouse
2009-02-26 20:53         ` Carl-Daniel Hailfinger
2009-02-26 20:32       ` Linus Torvalds
2009-02-26 19:55 ` Jesper Krogh
2009-02-26 20:33   ` Linus Torvalds
2009-02-26 20:43     ` Jesper Krogh
2009-02-26 21:19       ` john stultz
2009-02-26 21:35         ` Jesper Krogh
2009-02-26 21:46           ` john stultz
2009-02-26 21:54             ` Thomas Gleixner
2009-02-26 22:04               ` Jesper Krogh
2009-02-27  6:30             ` Jesper Krogh
2009-03-01 13:51             ` Jesper Krogh
2009-02-26 21:49           ` Linus Torvalds
2009-03-01 15:04             ` Jesper Krogh
2009-02-26 21:54           ` john stultz
2009-02-26 22:06             ` Thomas Gleixner
2009-02-26 22:24               ` Linus Torvalds
2009-02-26 22:31                 ` Linus Torvalds
2009-02-26 22:31               ` john stultz
2009-02-26 22:40                 ` Linus Torvalds
2009-02-26 22:59                   ` john stultz
2009-02-27  7:33                     ` Ingo Molnar
2009-02-27 20:50                       ` john stultz
2009-02-27  6:47                 ` Jesper Krogh
2009-02-27 20:35                   ` john stultz
2009-03-01 20:13                     ` Jesper Krogh
2009-03-02  9:53                     ` Jesper Krogh
2009-03-02 21:27                       ` john stultz
2009-03-03  6:04                         ` Jesper Krogh
2009-03-03 19:53                           ` john stultz
2009-03-03 20:19                             ` Jesper Krogh
2009-03-03 22:22                               ` john stultz
2009-03-04 15:30                                 ` Jesper Krogh
2009-03-04 18:36                                   ` Jesper Krogh
2009-03-04 18:57                                     ` John Stultz
2009-03-05  2:39                                       ` john stultz
2009-03-05  2:52                                         ` john stultz
2009-03-05  8:43                                           ` Ingo Molnar
2009-03-06  3:13                                             ` john stultz
2009-03-06  3:54                                               ` john stultz
2009-03-06 11:34                                                 ` Ingo Molnar
2009-03-09 20:42                                           ` Jesper Krogh
2009-03-10  4:26                                             ` Linus Torvalds
2009-03-10 11:29                                               ` Thomas Gleixner
2009-03-10 19:42                                                 ` Jesper Krogh
2009-03-10 22:22                                                   ` Thomas Gleixner
2009-03-15 19:53                                                     ` Jesper Krogh
2009-03-16 18:40                                                       ` Jesper Krogh
2009-03-15  1:19                                             ` Linus Torvalds
2009-03-15 15:44                                               ` Jesper Krogh
2009-03-15 18:09                                                 ` Linus Torvalds
2009-03-15 18:38                                                   ` Jesper Krogh
2009-03-15 19:02                                                     ` Linus Torvalds
2009-03-15 19:52                                                       ` Jesper Krogh
2009-03-16 18:59                                                         ` Jesper Krogh
2009-03-16 19:32                                                           ` Linus Torvalds
2009-03-17  1:43                                                             ` john stultz
2009-03-17  8:14                                                             ` Ingo Molnar
2009-03-17 15:48                                                               ` Linus Torvalds
2009-03-17 16:13                                                                 ` Ingo Molnar
2009-03-17 16:28                                                                   ` Linus Torvalds
2009-03-17 16:40                                                                     ` Ingo Molnar [this message]
2009-03-17 17:28                                                                   ` Olivier Galibert
2009-03-21  9:11                                                             ` Jesper Krogh
2009-03-21 10:06                                                               ` Ingo Molnar
2009-03-15 20:32                                                     ` Linus Torvalds
2009-03-03 20:39                             ` Jesper Krogh
2009-03-03 22:16                               ` john stultz
2009-03-04  5:36                                 ` Jesper Krogh
2009-03-01 15:09   ` Jesper Krogh
2009-03-01 15:44     ` Linux 2.6.29-rc6 (clocksource) Sitsofe Wheeler

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=20090317164051.GA32245@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=jesper@krogh.cc \
    --cc=johnstul@us.ibm.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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