From: "Ray Bryant" <raybry@mpdtxmail.amd.com>
To: "Andi Kleen" <ak@suse.de>
Cc: "Nicholas Miell" <nmiell@comcast.net>,
"Stephane Eranian" <eranian@hpl.hp.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: Tue, 29 Nov 2005 18:50:49 -0600 [thread overview]
Message-ID: <200511291850.49853.raybry@mpdtxmail.amd.com> (raw)
In-Reply-To: <20051129233920.GW19515@wotan.suse.de>
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
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
decision myself rather than have it enforced by the OS. Let me make the
tradeoffs about which is the most valuable in my particular situation,
please.
Furthermore, if I know what I am doing, I can still make use of the RDTSC to
do timing. Yes, I have to pin the process to the current cpu and yes I have
to force the power state to a known setup, and oh yeah, we have to turn off
the halt in the idle loop, etc., etc., but after doing it works quite nicely,
thank you. And you've got a tremendous education problem to get people not
to use the RDTSC and lots of existing programs that have to be modified.
So, sure, allow RDPMC from ring 3. For people who want to use RDPMC and
performance counter 0 for timing, let them do that.
The real issue here is that there needs to be a defined kernel interface to
allow user programs to allocate and use PMCs and that is part of what this
whole discussion on the perfctr-devel mailing list has been about. Let's
get that defined and then if a user requests PMC0 and insists on using it,
then perhaps the NMI watchdog will simply have to go away until PMC0 is
available to the kernel again.
I'm also not sure what the performance tradeoff between RDTSC/P and RDPMC is
across processor implementations, now and future. That's something that
needs to be looked at.
> And using virtual performance counters adds a large cost the
> context switch for changing the MSRs around. An always running counter
> avoids this problem.
>
> -Andi
--
Ray Bryant
AMD Performance Labs Austin, Tx
512-602-0038 (o) 512-507-7807 (c)
next prev parent reply other threads:[~2005-11-30 0:08 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 [this message]
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
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=200511291850.49853.raybry@mpdtxmail.amd.com \
--to=raybry@mpdtxmail.amd.com \
--cc=ak@suse.de \
--cc=discuss@x86-64.org \
--cc=eranian@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nmiell@comcast.net \
--cc=perfctr-devel@lists.sourceforge.net \
/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