[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wsgwp6gh.fsf@basil.nowhere.org>
Date: Sun, 28 Sep 2008 18:42:54 +0200
From: Andi Kleen <andi@...stfloor.org>
To: Pardo <pardo@...gle.com>
Cc: linux-kernel@...r.kernel.org, mbligh@...gle.com,
briangrant@...gle.com, odo@...gle.com, nil@...gle.com,
jyasskin@...gle.com
Subject: Re: Faster getcpu() and sched_getcpu()
Pardo <pardo@...gle.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@...ux.intel.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists