All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [patch] x86: unify/rewrite SMP TSC sync code
Date: Fri, 24 Nov 2006 22:06:36 +0100	[thread overview]
Message-ID: <200611242206.36681.ak@suse.de> (raw)
In-Reply-To: <20061124204636.GA12196@elte.hu>

On Friday 24 November 2006 21:46, Ingo Molnar wrote:
> 
> * Andi Kleen <ak@suse.de> wrote:
> 
> > 
> > > yeah - the main new bit for x86-64 is the unconditional check for time 
> > > warps. We shouldnt (and cannot) really trust the CPU and the board/BIOS 
> > > getting it right. There were always some motherboards using Intel CPUs 
> > > that had the TSCs wrong.
> > 
> > In the 64bit capable generation I don't know of any run in spec 
> > (except for multinode systems and there was one overclocked system 
> > where the cores got unsync, but overclocking is an operator error)
> 
> i have one (Intel based), 64-bit, fully in spec, which is off by 
> ~3000-4000 cycles. So it happens.

More details?

> I was in fact surprised when i noticed that you removed the 
> unconditional TSC check that i put there years ago 

I removed it because you pointed out that it usually caused
trouble on Intel systems: we would always detect errors due to measurement errors
and then make things worse by trying to fix it.

But you're right it might have been better to keep 
a check with a threshold to catch totally broken cases.

> but which apps are using RDTSC natively? Trapping isnt too good i agree

The only sure way would be to trap+printk -- but from previous
user complaints it's a substantial number.

> - if then we should remove it from the CPU features and hence apps wont 
> (or shouldnt) use it.

I doubt the majority checks any cpu features first ...

> 
> > > nor can the TSC really be synced up properly in the hotplug CPU 
> > > case, after the fact - what if the app already read out an older TSC 
> > > value and a new CPU is added. If the TSC isnt sync on SMP then it 
> > > quickly gets pretty messy, and we should rather take a look at /why/ 
> > > these apps are using RDTSC.
> > 
> > Because gettimeofday is too slow.
> 
> as i indicated it in another discussion, i can fix that. Next patch will 
> be that.

Well I hope it's not making it HZ resolution. As noted earlier we tried
that already and it didn't work (it violates the "forward monotonity"
that is commonly expected) 

Ok I could imagine it making sense as a new CLOCK_FASTBUTLOUSYRESOLUTION timer in 
clock_gettime() [together with the new vdso fastpath], but not as default.

-Andi

  reply	other threads:[~2006-11-24 21:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-24 17:02 [patch] x86: unify/rewrite SMP TSC sync code Ingo Molnar
2006-11-24 17:13 ` Andi Kleen
2006-11-24 20:25   ` Ingo Molnar
2006-11-24 20:37     ` Andi Kleen
2006-11-24 20:46       ` Ingo Molnar
2006-11-24 21:06         ` Andi Kleen [this message]
2006-11-24 22:48     ` Ben Greear
2006-11-25  2:56     ` Wink Saville
2006-11-25  8:30       ` Arjan van de Ven
2006-11-25 16:58         ` Wink Saville
2006-11-25 17:41           ` Arjan van de Ven
2006-11-25 20:34             ` Wink Saville
2006-11-27 19:00   ` Christoph Lameter
2006-11-29  7:13 ` Ingo Molnar
     [not found] <fa./NRPJg+JjfSQLUVwnX1GpHGIojQ@ifi.uio.no>
     [not found] ` <fa.Y0RKABHd+7qnbGQYBAGPvlJ0Qic@ifi.uio.no>
     [not found]   ` <fa.fD3WSpNqEJ4736vYzEak5Gf3xTw@ifi.uio.no>
     [not found]     ` <fa.A+gkQAO1DLThaxJxPLPl3yE1CGo@ifi.uio.no>
     [not found]       ` <fa.INurNKWdUKAEULTHyfpSW65a/Ng@ifi.uio.no>
     [not found]         ` <fa.n9vySiI9RS2MCl0DZPDzxZEPiFw@ifi.uio.no>
2006-11-26  7:20           ` Robert Hancock
2006-11-26  8:16             ` Wink Saville
2006-11-26  8:24               ` Arjan van de Ven
2006-11-26 19:48                 ` Wink Saville
2006-11-27  7:51                   ` Arjan van de Ven
2006-11-27  9:15                     ` Wink Saville
  -- strict thread matches above, loose matches on Subject: below --
2006-11-27 17:23 Robert Crocombe
2006-11-27 18:41 ` Max Krasnyansky

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=200611242206.36681.ak@suse.de \
    --to=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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.