Re: [PATCH next 0/3] iov: Optimise user copies

From: David Laight
Date: Sat Mar 22 2025 - 06:09:16 EST


On Fri, 21 Mar 2025 16:35:52 -0700
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 21 Mar 2025 at 15:46, David Laight <david.laight.linux@xxxxxxxxx> wrote:
> >
> > The speculation barrier in access_ok() is expensive.
> >
> > The first patch removes the initial checks when reading the iovec[].
> > The checks are repeated before the actual copy.
> >
> > The second patch uses 'user address masking' if supported.
> >
> > The third removes a lot of code for single entry iovec[].
>
> Ack, except I'd really like to see numbers for things that claim to
> remove expensive stuff.

Testing readv() of /dev/zero or writev() of /dev/null probably show
most gain.

I did do some allmodconfig builds and got no change, but I might have the
lfence compiled out of access_ok().
In any case kernel builds are pretty much user space limited.

David

>
> But yeah, the patches look sane.
>
> Linus