mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mihai Donțu" <mihai.dontu@gmail.com>
To: Andrew Lutomirski <luto@mit.edu>
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: Tue, 19 Apr 2011 03:49:00 +0300	[thread overview]
Message-ID: <20110419034900.6bd6484c@mdontu-dell.dsd.ro> (raw)
In-Reply-To: <BANLkTi=0gS2TSGgG15DbDPGttzCvEbEvaw@mail.gmail.com>

On Mon, 18 Apr 2011 15:32:52 -0400 Andrew Lutomirski <luto@mit.edu> wrote:
> Hi all-
> 
> I'd appreciate some help testing rdtsc's ordering wrt memory on
> various hardware.  You can download evil-clock-test code at:
> 
> https://gitorious.org/linux-test-utils/linux-clock-tests/blobs/raw/master/evil-clock-test.cc

On my laptop:
$ dmesg | grep -i tsc
[    0.000000] Fast TSC calibration using PIT
[    0.099991] TSC synchronization [CPU#0 -> CPU#1]:
[    0.099991] Measured 3156958390 cycles TSC warp between CPUs, turning off TSC clock.
[    0.099991] Marking TSC unstable due to check_tsc_sync_source failed

$ ./a.out
CPU vendor   : GenuineIntel
CPU model    : Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz
CPU stepping : 6
TSC flags    : tsc constant_tsc
Using lfence_rdtsc because you have an Intel CPU
Will test the "lfence;rdtsc" clock.
Now test passed  : margin 200 with 17193024 samples
Load3 test passed: margin 23270 with 45 samples
Load test passed : margin 70 with 3704403 samples
Store test failed as expected: worst error 50 with 3535212 samples

On a colleague's laptop:
$ dmesg | grep -i tsc
[    0.000000] Fast TSC calibration using PIT
[    0.339747] Marking TSC unstable due to TSC halts in idle

$ ./a.out 
CPU vendor   : GenuineIntel
CPU model    : Intel(R) Core(TM)2 Duo CPU     T9300  @ 2.50GHz
CPU stepping : 6
TSC flags    : tsc constant_tsc
Using lfence_rdtsc because you have an Intel CPU
Will test the "lfence;rdtsc" clock.
Now test passed  : margin 87 with 44323872 samples
Load3 test passed: margin 32062 with 28 samples
Load test passed : margin 62 with 14113177 samples
Store test failed as expected: worst error 850 with 12444429 samples

One of the servers I have around (2 x 6 core + HT):
$ dmesg | grep -i tsc
[    0.000000] Fast TSC calibration using PIT
[    0.398130] checking TSC synchronization [CPU#0 -> CPU#1]: passed.
[    0.577634] checking TSC synchronization [CPU#0 -> CPU#2]: passed.
[    0.757168] checking TSC synchronization [CPU#0 -> CPU#3]: passed.
[    0.936733] checking TSC synchronization [CPU#0 -> CPU#4]: passed.
[    1.116321] checking TSC synchronization [CPU#0 -> CPU#5]: passed.
[    1.295821] checking TSC synchronization [CPU#0 -> CPU#6]: passed.
[    1.475418] checking TSC synchronization [CPU#0 -> CPU#7]: passed.
[    1.654917] checking TSC synchronization [CPU#0 -> CPU#8]: passed.
[    1.834550] checking TSC synchronization [CPU#0 -> CPU#9]: passed.
[    2.014061] checking TSC synchronization [CPU#0 -> CPU#10]: passed.
[    2.193601] checking TSC synchronization [CPU#0 -> CPU#11]: passed.
[    2.373170] checking TSC synchronization [CPU#0 -> CPU#12]: passed.
[    2.552713] checking TSC synchronization [CPU#0 -> CPU#13]: passed.
[    2.732212] checking TSC synchronization [CPU#0 -> CPU#14]: passed.
[    2.911760] checking TSC synchronization [CPU#0 -> CPU#15]: passed.
[    3.091288] checking TSC synchronization [CPU#0 -> CPU#16]: passed.
[    3.270920] checking TSC synchronization [CPU#0 -> CPU#17]: passed.
[    3.450454] checking TSC synchronization [CPU#0 -> CPU#18]: passed.
[    3.629995] checking TSC synchronization [CPU#0 -> CPU#19]: passed.
[    3.809492] checking TSC synchronization [CPU#0 -> CPU#20]: passed.
[    3.989045] checking TSC synchronization [CPU#0 -> CPU#21]: passed.
[    4.168647] checking TSC synchronization [CPU#0 -> CPU#22]: passed.
[    4.348183] checking TSC synchronization [CPU#0 -> CPU#23]: passed.
[    4.577658] Switching to clocksource tsc

$ ./a.out
CPU vendor   : GenuineIntel
CPU model    : Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
CPU stepping : 2
TSC flags    : tsc rdtscp constant_tsc nonstop_tsc
Using lfence_rdtsc because you have an Intel CPU
Will test the "lfence;rdtsc" clock.
Now test passed  : margin 233 with 32792352 samples
Load3 test passed: margin 193 with 1912536 samples
Load test passed : margin 85 with 4347111 samples
Store test failed as expected: worst error 1996 with 3920055 samples

-- 
Mihai Donțu

  parent reply	other threads:[~2011-04-19  0:49 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
2011-04-18 22:10 ` Andi Kleen
2011-04-19  2:15   ` Andrew Lutomirski
2011-04-19  0:49 ` Mihai Donțu [this message]
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=20110419034900.6bd6484c@mdontu-dell.dsd.ro \
    --to=mihai.dontu@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@mit.edu \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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®