From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: venki@google.com, mingo@redhat.com
Subject: [RFC] Exposing TSC "reliability" to userland
Date: Mon, 3 May 2010 13:21:47 -0700 (PDT) [thread overview]
Message-ID: <18849d97-2fee-43a0-a3ea-9132f8163609@default> (raw)
In a patch posted late last year by Venki:
http://lkml.org/lkml/2009/12/17/360
it was noted that some systems that specify the "Invariant TSC"
bit in CPUID (on recent processors) are sadly not guaranteed to
have synchronized TSCs. As a result, Ingo's check_tsc_warp() is
executed; if the warp test passes, the kernel uses TSC
as clocksource and, if it doesn't pass, the kernel marks
the TSC as unstable and chooses a different clocksource.
Whether the kernel deems TSC to be reliable or not is a very
useful piece of information to userland, e.g. to certain
enterprise apps such the Oracle DB, some JVM's, etc. If
TSC IS reliable, rdtsc can be used by many of these
enterprise applications in many situations in place of a
gettimeofday call. Rdtsc can be much faster even than
a vsyscall and it is certainly much much faster when,
for one reason or another, vsyscall is not enabled.
This can make a huge performance difference in real
benchmarks when timestamps are frequently taken (10%
benchmark performance improvement was measured using
rdtsc vs gettimeofday syscall).
Running a warp test in userland is not nearly as accurate
as the warp test run by the kernel. So it makes sense to expose
the results of the kernel warp test to userland, maybe
through /sys/devices/system/clocksource/tsc_reliable
Comments?
next reply other threads:[~2010-05-03 20:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-03 20:21 Dan Magenheimer [this message]
2010-05-04 23:16 ` [RFC] Exposing TSC "reliability" to userland Venkatesh Pallipadi
2010-05-04 23:51 ` Dan Magenheimer
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=18849d97-2fee-43a0-a3ea-9132f8163609@default \
--to=dan.magenheimer@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=venki@google.com \
--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