public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mikael Pettersson <mikpe@csd.uu.se>,
	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 16:33:23 +0200	[thread overview]
Message-ID: <20020821143323.GF1117@dualathlon.random> (raw)
In-Reply-To: <1029939024.26425.49.camel@irongate.swansea.linux.org.uk>

On Wed, Aug 21, 2002 at 03:10:24PM +0100, Alan Cox wrote:
> On Wed, 2002-08-21 at 14:12, Andrea Arcangeli wrote:
> > 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.
> 
> Totally untrue. When you are doing profiling the data is very useful
> because CPU switches are trivial to filter and statistically rare

You can use statistic to guess what are the measurements that you've to
filter agreed, however this mostly applies to hot cache measurements
(likely to return many times the same result if there's no error) and in
particular where you are allowed to waste cpu time in repeating many
times the same workload before you say "ok this is the right measure".

Filtering out the errors is not feasible in all the cases, even if you
are allowed to repeat the same measurement multiple times. And it also
depends if you have a 3-way pipe communication in background.

And you'll keep to silenty break in all other applications that uses
rdtsc to know how much time has passed, that can hardly understand if
they can use the tsc or not unless we tell it to them from the kernel.

If you want to use the tsc in a controlled manner using statistic for
just profiling of a certain piece of code where it is easy to
demonstrate the absolute most frequent result is the correct one (as
said it's not always the case, when you do measurements out of hot cpu
cache the masurements vary significantly all the time, you are very well
aware about it), at the very least it should be a  privilegied sysctl or
a non privilegied prctl (prctl however requires a slowdown of
swithc_to). Infact if we add a branch to switch_to we could even
automatically allow it for processes that are bind to a single cpu (or
to a single NUMA node adding some more internal knowledge about the numa
topology).

But silenty breaking apps and not allowing in any way to apps to learn
if the tsc is returning random or if it's returning something
significant (I understand that's the way you did it in -ac) is a no-way
by default IMHO.

Andrea

  reply	other threads:[~2002-08-21 14:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-08  1:53 [PATCH] tsc-disable_B9 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
2002-08-21 14:10             ` Alan Cox
2002-08-21 14:33               ` Andrea Arcangeli [this message]
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=20020821143323.GF1117@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