mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-01 13:46:42 +07:00
51c19b4f59
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>
31 lines
625 B
C
31 lines
625 B
C
/*
|
|
* Copyright 2006 Andi Kleen, SUSE Labs.
|
|
* Subject to the GNU Public License, v.2
|
|
*
|
|
* Fast user context implementation of getcpu()
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/getcpu.h>
|
|
#include <linux/jiffies.h>
|
|
#include <linux/time.h>
|
|
#include <asm/vsyscall.h>
|
|
#include <asm/vgtod.h>
|
|
|
|
notrace long
|
|
__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)
|
|
{
|
|
unsigned int p;
|
|
|
|
p = __getcpu();
|
|
|
|
if (cpu)
|
|
*cpu = p & VGETCPU_CPU_MASK;
|
|
if (node)
|
|
*node = p >> 12;
|
|
return 0;
|
|
}
|
|
|
|
long getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *tcache)
|
|
__attribute__((weak, alias("__vdso_getcpu")));
|