[PATCH] powerpc: Add VDSO version of getcpu

2012-07-04 Thread Anton Blanchard
We have a request for a fast method of getting CPU and NUMA node IDs from userspace. This patch implements a getcpu VDSO function, similar to x86. Ben suggested we use SPRG3 which is userspace readable. SPRG3 can be modified by a KVM guest, so we save the SPRG3 value in the paca and restore it wh

Re: [PATCH] powerpc: Add VDSO version of getcpu

2012-06-25 Thread Benjamin Herrenschmidt
On Mon, 2012-06-25 at 11:55 +1000, Anton Blanchard wrote: > We had a request for a fast method of getting CPU and NUMA node IDs > from userspace. Ben suggested we use SPRG3 which is userspace > readable. This is a quick hack to try that out. > > I have a glibc patch to implement sched_getcpu using

[PATCH] powerpc: Add VDSO version of getcpu

2012-06-24 Thread Anton Blanchard
We had a request for a fast method of getting CPU and NUMA node IDs from userspace. Ben suggested we use SPRG3 which is userspace readable. This is a quick hack to try that out. I have a glibc patch to implement sched_getcpu using this. Testing on a POWER7: baseline: 538 cycles vdso: 30 cy