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>
This commit is contained in:
Marcelo Tosatti
2012-11-27 23:28:57 -02:00
parent 3dc4f7cfb7
commit 51c19b4f59
3 changed files with 101 additions and 11 deletions

View File

@@ -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;