lkml.org 
[lkml]   [2018]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set
> I initially tried getpid() which I found to be cached by glibc, but I
> switched to write(-1, "a", 1) in the example in the cover letter and
> the test for 3 million runs roughly climbs from 200 ms to 900 ms under
> kvm (with PCID this time, I didn't retest without).

umask() is the fastest system call I think.
Also who cares about glibc caching?

static inline int sys_umask(int mask)
{
int rv;
asm volatile (
"syscall"
: "=a" (rv)
: "0" (95), "D" (mask)
: "rcx", "r11", "cc", "memory"
);
return rv;
}

int main(void)
{
unsigned int i;

for (i = 0; i < (1U << 24); i++) {
sys_umask(0);
}
return 0;
}

\
 
 \ /
  Last update: 2018-01-14 23:24    [W:0.041 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site