Re: [PATCH v2] x86: bring back rep movsq for user access on CPUs without ERMS

From: Mateusz Guzik
Date: Sun Sep 03 2023 - 16:53:21 EST


On Sun, Sep 03, 2023 at 01:08:03PM -0700, Linus Torvalds wrote:
> On Sun, 3 Sept 2023 at 11:49, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > So I have no idea why you claim that "currently they have no choice".
> > glibc is simply being incredibly stupid, and using newfstatat() for no
> > good reason.
>
> Do you have any good benchmark that shows the effects of this?
>
> And if you do, does the attached patch (ENTIRELY UNTESTED!) fix the
> silly glibc mis-feature?
>

"real fstat" is syscall(5, fd, &sb).

Sapphire Rapids, will-it-scale, ops/s

stock fstat 5088199
patched fstat 7625244 (+49%)
real fstat 8540383 (+67% / +12%)

It dodges lockref et al, but it does not dodge SMAP which accounts for
the difference.