The traditional fast system call to test is getppid().

write() goes through a lot more code.

    Linus

On Jan 11, 2018 13:24, "Willy Tarreau" <w@1wt.eu> wrote:
On Thu, Jan 11, 2018 at 07:34:31PM +0000, Alan Cox wrote:
> On Thu, 11 Jan 2018 13:26:01 -0600
> Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> > On Thu, Jan 11, 2018 at 08:19:35PM +0100, Olivier Galibert wrote:
> > > Wouldn't the time taken by an easy syscall like getuid be a clear indicator?
> >
> > I think only if you had a baseline measurement to compare against.
>
> getuid can also be cached by a smart libc. getppid() is what micro
> benchmarks seem to favour.

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).

Willy