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

From: Linus Torvalds
Date: Sun Sep 03 2023 - 23:07:48 EST


On Sun, 3 Sept 2023 at 16:15, Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
>
> bad news: virtually no difference for stat(2) (aka newfstatat)
> before: 3898139
> after: 3922714 (+0%)

Yeah, the path lookup is way more expensive than a slight win in a L1
copy, and the pathname lookup will also have gone much deeper on the
stack.

> ok news: a modest win for the actual fstat system call (aka newfstat,
> *not* the libc wrapper calling newfstatat)
> before: 8511283
> after: 8746829 (+2%)

We might end up with slightly less deep stack, so potentially a
smaller cache footprint, and there is much less other stuff going on..

> The patch as proposed is kind of crap -- moving all that handling out
> of fs/stat.c is quite weird and trivially avoidable, with a way to do
> it already present in the file.

So you say. I claim that you're full of crap.

Try it and you'll see it is not even *remotely* as easy as you claim.
Not when you have to deal with random sizes and padding of 20+
different architectures.

Linus