From: Stephane Eranian <eranian@hpl.hp.com>
To: Nicholas Miell <nmiell@comcast.net>
Cc: Andi Kleen <ak@suse.de>, Ray Bryant <raybry@mpdtxmail.amd.com>,
discuss@x86-64.org, linux-kernel@vger.kernel.org,
perfctr-devel@lists.sourceforge.net
Subject: Re: [Perfctr-devel] Re: Enabling RDPMC in user space by default
Date: Wed, 30 Nov 2005 07:48:15 -0800 [thread overview]
Message-ID: <20051130154815.GA8511@frankl.hpl.hp.com> (raw)
In-Reply-To: <1133338962.3271.42.camel@entropy>
Nicholas,
On Wed, Nov 30, 2005 at 12:22:42AM -0800, Nicholas Miell wrote:
> On Tue, 2005-11-29 at 23:38 -0800, Stephane Eranian wrote:
> > Nicholas,
> >
> > On Tue, Nov 29, 2005 at 03:29:26PM -0800, Nicholas Miell wrote:
> > > On Wed, 2005-11-30 at 00:17 +0100, Andi Kleen wrote:
> > > > On Tue, Nov 29, 2005 at 03:02:18PM -0800, Nicholas Miell wrote:
> > > > > On Tue, 2005-11-29 at 23:43 +0100, Andi Kleen wrote:
> > > > > > To give an bad analogy RDTSC usage in the last years is
> > > > > > like explicit spinning wait loops for delays in the earlier
> > > > > > times. They tended to work on some subset of computers,
> > > > > > but were always bad and caused problems and people eventually learned
> > > > > > it was better to use operating system services for this.
> > > > >
> > > > > And you are now suggesting people should use RDPMC instead of OS
> > > > > services?
> > > >
> > > > For any kind of timers they should use the OS service
> > > > (gettimeofday/clock_gettime). The OS will go to extraordinary
> > > > means to make it as fast as possible, but when it's slow
> > > > then because it's not possible to do it faster accurately
> > > > (that's the case right now modulo one possible optimization)
> > > >
> > > > For cycle counting where they previously used RDTSC they should
> > > > use RDPMC 0 now.
> > >
> > > Well, if that's all you want them to use RDPMC 0 for, why not just make
> > > PMCs programmable from userspace?
> > >
> > Simply because write a PERFSEL (i.e. an MSR) register is a privileged operation.
>
> Well, yeah. Design an API (or just steal from Solaris) and expose that
> to userspace.
>
And that is exactly what I am doing with the perfmon2 interface that I
am working on. It does expose the performance counters to users via
a system call. With it you can certainly program a PERFSEL to count
cycles and you can use RDPMC from ring 3 to read the current value.
--
-Stephane
next prev parent reply other threads:[~2005-11-30 15:49 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-29 15:15 Enabling RDPMC in user space by default Andi Kleen
2005-11-29 16:04 ` Mikael Pettersson
2005-11-29 16:17 ` Andi Kleen
2005-11-29 16:56 ` Ray Bryant
2005-11-29 16:15 ` Andi Kleen
2005-11-29 18:09 ` [Perfctr-devel] " Stephane Eranian
2005-11-29 18:13 ` Andi Kleen
2005-11-29 18:29 ` John Reiser
2005-11-29 18:38 ` Andi Kleen
2005-11-29 19:05 ` Lee Revell
2005-11-29 21:43 ` Nicholas Miell
2005-11-29 21:52 ` Andi Kleen
2005-11-29 22:19 ` Stephane Eranian
2005-11-29 22:51 ` [discuss] " Andi Kleen
2005-11-30 16:01 ` Stephane Eranian
2005-11-30 16:23 ` Andi Kleen
2005-12-01 23:41 ` Stephane Eranian
2005-12-02 0:07 ` Andi Kleen
2005-12-02 7:09 ` Stephane Eranian
2005-12-02 11:36 ` Andi Kleen
2005-11-29 22:33 ` Nicholas Miell
2005-11-29 22:43 ` Andi Kleen
2005-11-29 23:02 ` Nicholas Miell
2005-11-29 23:17 ` Andi Kleen
2005-11-29 23:29 ` Nicholas Miell
2005-11-29 23:39 ` Andi Kleen
2005-11-29 23:56 ` David Gibson
2005-11-30 0:34 ` Andi Kleen
2005-11-30 0:52 ` David Gibson
2005-11-30 1:04 ` [discuss] " Andi Kleen
2005-11-30 0:50 ` Ray Bryant
2005-11-30 0:38 ` Andi Kleen
2005-11-30 7:38 ` Stephane Eranian
2005-11-30 8:22 ` Nicholas Miell
2005-11-30 15:48 ` Stephane Eranian [this message]
2005-11-29 23:07 ` David Gibson
2005-11-29 23:18 ` [discuss] " Andi Kleen
2005-11-29 23:28 ` Bernd Schmidt
2005-11-29 23:46 ` [discuss] " Andi Kleen
2005-11-30 2:39 ` Zwane Mwaikambo
2005-11-30 3:38 ` Andi Kleen
2005-12-01 4:08 ` Zwane Mwaikambo
2005-12-01 13:05 ` Andi Kleen
2005-12-01 17:01 ` Zwane Mwaikambo
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=20051130154815.GA8511@frankl.hpl.hp.com \
--to=eranian@hpl.hp.com \
--cc=ak@suse.de \
--cc=discuss@x86-64.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nmiell@comcast.net \
--cc=perfctr-devel@lists.sourceforge.net \
--cc=raybry@mpdtxmail.amd.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