summaryrefslogtreecommitdiffstats
path: root/arch/x86/vdso/vgetcpu.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2012-11-27 23:28:57 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2012-11-27 23:29:11 -0200
commit51c19b4f5927f5a646e93d69f73c7e89ea14e737 (patch)
treea48486f72dc433fd516684d4441022650429d333 /arch/x86/vdso/vgetcpu.c
parent3dc4f7cfb7441e5e0fed3a02fc81cdaabd28300a (diff)
x86: vdso: pvclock gettime support
Improve performance of time system calls when using Linux pvclock, by reading time info from fixmap visible copy of pvclock data. Originally from Jeremy Fitzhardinge. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/vdso/vgetcpu.c')
-rw-r--r--arch/x86/vdso/vgetcpu.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/vdso/vgetcpu.c b/arch/x86/vdso/vgetcpu.c
index 5463ad55857..2f94b039e55 100644
--- a/arch/x86/vdso/vgetcpu.c
+++ b/arch/x86/vdso/vgetcpu.c
@@ -17,15 +17,10 @@ __vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
{
unsigned int p;
- if (VVAR(vgetcpu_mode) == VGETCPU_RDTSCP) {
- /* Load per CPU data from RDTSCP */
- native_read_tscp(&p);
- } else {
- /* Load per CPU data from GDT */
- asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
- }
+ p = __getcpu();
+
if (cpu)
- *cpu = p & 0xfff;
+ *cpu = p & VGETCPU_CPU_MASK;
if (node)
*node = p >> 12;
return 0;