From: Andrea Arcangeli <andrea@suse.de>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
john stultz <johnstul@us.ibm.com>,
Marcelo Tosatti <marcelo@conectiva.com.br>,
lkml <linux-kernel@vger.kernel.org>,
Leah Cunningham <leahc@us.ibm.com>,
wilhelm.nuesser@sap.com, paramjit@us.ibm.com, msw@redhat.com
Subject: Re: [PATCH] tsc-disable_B9
Date: Wed, 21 Aug 2002 15:12:23 +0200 [thread overview]
Message-ID: <20020821131223.GB1117@dualathlon.random> (raw)
In-Reply-To: <15708.64483.439939.850493@kim.it.uu.se>
On Fri, Aug 16, 2002 at 03:19:31PM +0200, Mikael Pettersson wrote:
> Alan Cox writes:
> > On Thu, 2002-08-15 at 17:56, Andrea Arcangeli wrote:
> > > sorry but I don't see the point of badtsc only in kernel.
> > >
> > > If the TSC is bad that will be in particular bad from userspace where
> > > there's no hope to know what CPU you're running on.
> >
> > You can still do meaningful measurements for things like profiling
> > because the cpu hop is statistically uninteresting.
>
> There are kernel extensions around that handle process migration across
> CPUs while providing virtualised per-process TSC counts, and for which
> the TSCs do NOT need to be in perfect sync.
you mean trapping the instruction fault and emulating the tsc with a
gettimeofday? In such case you should run gettimeofday in the first
place. that's the whole point. rdtsc means rdtsc, not a software
emulation of it. If you don't want to bind your userspace to a certain
system that has tsc in sync, you should use gettimeofday since the first
place so it'll run on non x86 too.
Infact returning an instruction fault is probably one of the best way to
allow a program to autodetect if the tsc is useful. Otherwise if you
left the tsc enabled, it'll be hard for userspace to guess if the tsc
are in sync (you could with cpu binding but only if you have
privilegies, normal programs wouldn't be capable of probing that).
> Disabling user-space RDTSC just because the TSCs aren't in sync is stupid.
what you mean as non stupid has to be to still disable it (so figure out
how much disabling it is stupid) and to trap the instruction fault and
software emulate the tsc so that userspace will think the TSC aren't
disabled while they're are infact disabled.
However here the point is that the TSC was left _enabled_ (not disabled
and emulated as you are advocating) despite it was not in sync. That
cannot make any sense, except if you use the tsc as a random number
generator.
Andrea
next prev parent reply other threads:[~2002-08-21 13:07 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 1:53 john stultz
2002-08-08 2:15 ` [PATCH] cyclone-timer_A9 john stultz
2002-08-08 13:18 ` Alan Cox
2002-08-09 2:03 ` john stultz
2002-08-08 13:17 ` [PATCH] tsc-disable_B9 Alan Cox
2002-08-09 2:30 ` john stultz
2002-08-09 9:17 ` Alan Cox
2002-08-09 17:46 ` john stultz
2002-08-09 18:49 ` george anzinger
2002-08-09 20:58 ` john stultz
2002-08-13 1:23 ` James Cleverdon
2002-08-11 20:16 ` Alan Cox
2002-08-15 16:56 ` Andrea Arcangeli
2002-08-16 11:15 ` Alan Cox
2002-08-16 13:19 ` Mikael Pettersson
2002-08-21 13:12 ` Andrea Arcangeli [this message]
2002-08-21 14:10 ` Alan Cox
2002-08-21 14:33 ` Andrea Arcangeli
2002-08-21 15:01 ` Alan Cox
2002-08-21 16:13 ` Andrea Arcangeli
2002-08-21 16:25 ` Alan Cox
2002-08-21 17:17 ` Andrea Arcangeli
2002-08-21 17:34 ` Alan Cox
2002-08-26 16:10 ` Pavel Machek
2002-08-26 18:45 ` Martin J. Bligh
2002-08-26 19:00 ` Pavel Machek
2002-08-26 19:05 ` Alan Cox
2002-08-26 20:19 ` Martin J. Bligh
2002-08-26 19:18 ` Richard B. Johnson
2002-08-26 19:42 ` Pavel Machek
2002-08-26 20:23 ` Alan Cox
2002-08-26 22:49 ` Andrea Arcangeli
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=20020821131223.GB1117@dualathlon.random \
--to=andrea@suse.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=johnstul@us.ibm.com \
--cc=leahc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=mikpe@csd.uu.se \
--cc=msw@redhat.com \
--cc=paramjit@us.ibm.com \
--cc=wilhelm.nuesser@sap.com \
/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®