Re: [Perfctr-devel] Re: Enabling RDPMC in user space by default

Andi Kleen
2005-11-30T00:38:27Z

On Tue, Nov 29, 2005 at 06:50:49PM -0600, Ray Bryant wrote:
> On Tuesday 29 November 2005 17:39, Andi Kleen wrote:
> > > Well, if that's all you want them to use RDPMC 0 for, why not just make
> > > PMCs programmable from userspace?
> >
> > First we need to have a cycle counter PMC anyways for the NMI watchdog.
> > So it can as well be used for other purposes.
> >
>
> Yes, but that assumes having the NMI watchdog around is more important to you
> than having 4 performance counters available. I'm perfectly willing to

Stable kernels are important to everyone. And we can only
get stable kernels if the bug reports are good. And that needs
the NMI watchdog.

Also see it differently - with the default ticking counter exported you
have a nice relatively reliable (you need to pin to CPUs) way to measure
cycles of instructions now. Previously that wasn't possible or rather
required one to jump through all kinds of hops to get right. My opinion
is that RDTSC is becoming less and less usable for this kind of stuff,
but since micro measurements are important for many cases it's important
to offer a nice facility for them.

> have the NMI watchdog around by default, since it seems to be useful in most
> cases. But if my measurement study needs 4 PMC's to do its job and I am
> willing to forgo use of the NMI watchdog for that period of time, why
> shouldn't I be allowed to do that? We have few enough PMCs anyway, I just
> don't like the idea of giving one up forever. I'd much prefer to make that

You don't give it up - it's just dedicated to counting cycles, free
for everybody to use.

-Andi