From: "H. Peter Anvin" <hpa@kernel.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [1/3] Provide rdtscll() asm/msr.h for user space
Date: Tue, 07 Oct 2008 14:32:05 -0700 [thread overview]
Message-ID: <48EBD555.9060104@kernel.org> (raw)
In-Reply-To: <20081007143.793379346@firstfloor.org>
Andi Kleen wrote:
> For simple user space timing it's very useful to be able to do
> #include <asm/msr.h> instead of having to cut'n'paste the necessarily
> macros into all programs. This used to work with older kernels,
> but broke with the paravirt support (I ended up with a bunch of
> test programs that broke because of that). But it's very useful
> to have rdtscll() available somewhere in user space and asm/msr.h
> is a good place to have them.
>
> Provide simple rdtsc/rdtscl() macros for user space too in asm/msr.h.
> Since they are very simple I don't think they are a burden to maintain.
>
> The diff looks bigger than it is because I moved a code block
> and diff doesn't handle it very well.
I really don't think this belongs in the kernel. It's not even a case
of "usable by accident" anymore, and hasn't worked for a while, so it's
not a matter of legacy, either.
Mixing fundamentally unrelated kernel and userspace variants of the same
function just makes the aggregation uglier than both.
(Also, most userspace variants I have seen have what the kernel calls
"rdtscll" and calls it "rdtsc".)
I would suggest writing a <sys/tsc.h> header file and submitting to the
glibc people, instead, or perhaps even better, start a libarch/libx86 tree.
-hpa
next prev parent reply other threads:[~2008-10-07 21:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-07 11:43 [PATCH] [1/3] Provide rdtscll() asm/msr.h for user space Andi Kleen
2008-10-07 11:43 ` [PATCH] [2/3] Use the fancy DECLARE_EAX_EDX macros for rdtscp too Andi Kleen
2008-10-07 11:43 ` [PATCH] [3/3] Remove unused EAX_EDX_ARGS Andi Kleen
2008-10-07 21:32 ` H. Peter Anvin [this message]
2008-10-07 23:11 ` [PATCH] [1/3] Provide rdtscll() asm/msr.h for user space Andi Kleen
2008-10-07 23:25 ` H. Peter Anvin
2008-10-07 23:37 ` Andi Kleen
2008-10-07 23:45 ` H. Peter Anvin
2008-10-07 23:42 ` [PATCH] [1/3] Provide rdtscll() asm/msr.h for user space II Andi Kleen
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=48EBD555.9060104@kernel.org \
--to=hpa@kernel.org \
--cc=andi@firstfloor.org \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).