mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lutomirski <luto@mit.edu>
To: Colin Walters <walters@verbum.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, x86 <x86@kernel.org>
Subject: Re: [RFT] Please test rdtsc on various x86-64 hardware (app included)
Date: Mon, 18 Apr 2011 16:39:21 -0400	[thread overview]
Message-ID: <BANLkTikqCWVapeFgGe6OLS5+8N8OugirKA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimL+x+CwHKLkpMsY7kGsk3WkWHvpw@mail.gmail.com>

On Mon, Apr 18, 2011 at 4:35 PM, Colin Walters <walters@verbum.org> wrote:
> On Mon, Apr 18, 2011 at 4:27 PM, Andrew Lutomirski <luto@mit.edu> wrote:
>
>> Well, crap.  Can you run:
>>  dmesg | grep -i tsc
>
> # dmesg|grep -i tsc
> [    0.000000] Fast TSC calibration using PIT
> [    0.098999] TSC synchronization [CPU#0 -> CPU#1]:
> [    0.098999] Measured 2399269672 cycles TSC warp between CPUs,
> turning off TSC clock.
> [    0.098999] Marking TSC unstable due to check_tsc_sync_source failed
>
>> There are two possible explanations:
>> 1. Your tscs are out of sync, and whether the test notices or not
>> depends on which cpus the scheduler sticks the threads on.
>
> Looks like that's the case?   But for what you want to do in kernel,
> the kernel already did this test and so would know to not use the TSC
> for vgettimeofday(), right?  (I only sort of followed the clock
> discussion earlier but I found it quite interesting, so decided to run
> the test).
>

Yes, the kernel won't run this code at all on your system.  That being
said, you have the constant_tsc flag and the error my tool measured is
pretty close to the error the kernel measured at boot, so it might be
interesting for the kernel to learn how to synchronize the TSCs
itself.  This is possible, abeit awkward, on newish Intel CPUs.  It's
possible but *really* awkward on older CPUs.

--Andy

  reply	other threads:[~2011-04-18 20:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 19:32 Andrew Lutomirski
2011-04-18 20:16 ` Linus Torvalds
2011-04-18 20:37   ` Ingo Molnar
2011-04-19  0:38     ` Markus Trippelsdorf
2011-04-18 20:23 ` Colin Walters
2011-04-18 20:27   ` Andrew Lutomirski
2011-04-18 20:35     ` Colin Walters
2011-04-18 20:39       ` Andrew Lutomirski [this message]
2011-04-18 22:10 ` Andi Kleen
2011-04-19  2:15   ` Andrew Lutomirski
2011-04-19  0:49 ` Mihai Donțu
2011-04-19  8:10 ` Frank Kingswood
2011-04-22 14:33 ` Jan Ceuleers
2011-04-19  5:06 George Spelvin
2011-04-19  6:09 ` George Spelvin

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=BANLkTikqCWVapeFgGe6OLS5+8N8OugirKA@mail.gmail.com \
    --to=luto@mit.edu \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=walters@verbum.org \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®