RE: [PATCH v3 2/2] iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()
From: David Laight
Date: Fri Aug 18 2023 - 08:42:24 EST
From: Matthew Wilcox
> Sent: Friday, August 18, 2023 1:27 PM
>
> On Fri, Aug 18, 2023 at 12:16:23PM +0000, David Laight wrote:
> > > > + ITER_IOVEC = 1,
> > > > + ITER_UBUF = 2,
> > > > + ITER_KVEC = 4,
> > > > + ITER_BVEC = 8,
> > > > + ITER_XARRAY = 16,
> > > > + ITER_DISCARD = 32,
> >
> > IIRC Linus had type:6 - that doesn't leave any headroom
> > for additional types (even though they shouldn't proliferate).
>
> I have proposed an ITER_KBUF in the past (it is to KVEC as UBUF is
> to IOVEC). I didn't care enough to keep pushing it, but it's clearly
> a common idiom.
Indeed, I didn't spot UBUF going in - I spot a lot of stuff.
I did wonder if you could optimise for a vector length of 1
(inside the KVEC conditional).
That would also pick up the cases where there only happens
to be a single buffer.
I also remember writing a patch that simplified import_iovec()
by combining the iov_iter with a struct iovec iovec[UIO_FASTIOV].
All got bogged down in io_uring which would need changing first.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)