public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Enabling RDPMC in user space by default
@ 2005-11-29 15:15 Andi Kleen
  2005-11-29 16:04 ` Mikael Pettersson
                   ` (2 more replies)
  0 siblings, 3 replies; 44+ messages in thread
From: Andi Kleen @ 2005-11-29 15:15 UTC (permalink / raw)
  To: discuss; +Cc: linux-kernel

Hallo,

I'm considering to enable CR4.PCE by default on x86-64/i386. Currently it's 0
which means RDPMC doesn't work. On x86-64 PMC 0 is always programmed
to be a cycle counter, so it would be useful to be able to access
this for measuring instructions. That's especially useful because RDTSC 
does not necessarily count cycles in the current P state (already
the case on Intel CPUs and AMD's future direction seems to also
to decouple it from cycles) Drawback is that it stops during idle, but 
that shouldn't be a big issue for normal measuring. It's not useful
as a real timer anyways.

On Pentium 4 it also has the advantage that unlike RDTSC it's not
serializing so should be much faster.

The kernel change would be to always set CR4.PCE to allow RDPMC
in ring 3. 

It would be actually a good idea to disable RDTSC in ring 3 too
(because user space usually doesn't have enough information to make
good use of it and gets it wrong), but I fear that will break 
too many applications right now.

Any comments on this? 

-Andi


^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2005-12-02 11:36 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox