From: Andi Kleen <andi@firstfloor.org>
To: Pardo <pardo@google.com>
Cc: linux-kernel@vger.kernel.org, mbligh@google.com,
briangrant@google.com, odo@google.com, nil@google.com,
jyasskin@google.com
Subject: Re: Faster getcpu() and sched_getcpu()
Date: Sun, 28 Sep 2008 18:42:54 +0200 [thread overview]
Message-ID: <87wsgwp6gh.fsf@basil.nowhere.org> (raw)
In-Reply-To: <af8810200809231209w7428347neb88094e543a048f@mail.gmail.com> (pardo@google.com's message of "Tue, 23 Sep 2008 12:09:14 -0700")
Pardo <pardo@google.com> writes:
>
> ANALYSIS AND SUGGESTIONS
>
> Caching is currently disabled for 2.6.26/arch/x86/vdso/vgetcpu.c.
> getcpu()/sched_getcpu() performance is most important when they are
> used very frequently, in which case the jiffy-based cache is
> effective. Conversely, when calls are infrequent, cache miss overhead
> is small. Recommendation: caching should be enabled (probably for all
> architectures, not just x86-64).
Without a vsyscall the cache probably doesn't make too much sense
because once you're in the kernel reading the real CPU number is really
cheap.
I agree with you that the cache should be enabled on all vDSO implementations
(that is what my original code did)
Also the TSCP version could probably go.
I'm still not sure why you say no redzone is that expensive? Do you
have numbers? I know it's a few instructions, but it shouldn't
be that expensive.
> A specialized version of the VDSO code for sched_getcpu() is
> substantially faster than calling getcpu().
Yes, unfortunately glibc didn't chose the same interface as the kernel
for this. I still don't know why. But now since we're in this mess
specializing for the glibc implementation is probably a good idea.
Or just add getcpu() to glibc :)
-Andi
--
ak@linux.intel.com
next prev parent reply other threads:[~2008-09-28 16:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <af8810200809111648n55e05ac9g286fcd498690432f@mail.gmail.com>
2008-09-23 19:09 ` Faster getcpu() and sched_getcpu() Pardo
2008-09-23 19:48 ` Fwd: " Pardo
2008-09-28 16:42 ` Andi Kleen [this message]
2008-09-29 7:27 ` dean gaudet
2008-09-29 14:54 ` Andi Kleen
2008-09-29 18:02 ` Pardo
[not found] ` <af8810200809291101r6f3208beua36a4b2d3b5713eb@mail.gmail.com>
2008-09-29 20:50 ` Andi Kleen
[not found] ` <48E14ECE.6080402@google.com>
2008-09-29 21:59 ` dean gaudet
2008-09-29 22:07 ` 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=87wsgwp6gh.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=briangrant@google.com \
--cc=jyasskin@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@google.com \
--cc=nil@google.com \
--cc=odo@google.com \
--cc=pardo@google.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