All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	asit.k.mallick@intel.com
Subject: Re: [patch] x86, tsc: fix SMI induced variation in quick_pit_calibrate()
Date: Mon, 16 Jan 2012 16:41:09 -0800	[thread overview]
Message-ID: <1326760869.16150.16.camel@sbsiddha-desk.sc.intel.com> (raw)
In-Reply-To: <CA+55aFys9zddHAoKURGAeu0QYD_MC11uEyOQGU_4Ybsf200NkQ@mail.gmail.com>

On Mon, 2012-01-16 at 16:18 -0800, Linus Torvalds wrote:
> So I think your patch is a total hack that just compares the two last
> TSC deltas, but it's actually close to the "correct' thing in that it
> does start taking the time to see the last of the previous MSB into
> account.

yeah, it was a hack but your alternative sounds good.

> Now the delta is twice as big as before (it covers four PIT accesses,
> roughly 4us), so the comments might have to be updated to match, but
> the rest of the code should "just work" (except it might loop a bit
> longer, and maybe it gives closer to 250 ppm precision).
> 
> Does this fix it for you? I have NOT tested it in any way.
> 

also may be we should change the correction 

from: delta += (long)(d2 - d1)/2;
to:   delta += (long)(d2 - d1)/4;

I will give this patch a try.

thanks,
suresh




  reply	other threads:[~2012-01-17  0:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 20:15 [patch] x86, tsc: fix SMI induced variation in quick_pit_calibrate() Suresh Siddha
2012-01-17  0:18 ` Linus Torvalds
2012-01-17  0:41   ` Suresh Siddha [this message]
2012-01-17  0:52     ` Linus Torvalds
2012-01-17  1:30       ` Linus Torvalds
2012-01-17  4:06         ` Suresh Siddha
2012-01-17  5:15           ` Linus Torvalds
2012-01-17 23:35             ` Suresh Siddha
2012-01-18  0:25               ` [tip:x86/urgent] x86, tsc: Fix " tip-bot for Linus Torvalds
2012-01-17  2:47 ` [patch] x86, tsc: fix " Yinghai Lu

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=1326760869.16150.16.camel@sbsiddha-desk.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.