Messages in this thread | | | From | David Laight <> | Subject | RE: [RFC 08/13] cifs: Add a function to read into an iter from a socket | Date | Thu, 26 Jan 2023 16:09:05 +0000 |
| |
From: David Howells > Sent: 26 January 2023 15:44 ... > > I'm also not 100% sure that taking a copy of an iov_iter is a good idea. > > It shouldn't matter as the only problematic iterator is ITER_PIPE (advancing > that has side effects) - and splice_read is handled specially by patch 4. The > problem with splice_read with the way cifs works is that it likes to subdivide > its read/write requests across multiple reqs and then subsubdivide them if > certain types of failure occur. But you can't do that with ITER_PIPE.
I was thinking that even if ok at the moment it might be troublesome later. Somewhere I started writing a patch to put the iov_cache[] for user requests into the same structure as the iterator. Copying those might cause oddities.
> I build an ITER_BVEC from ITER_PIPE, ITER_UBUF and ITER_IOVEC in the top > levels with pins inserted as appropriate and hand the ITER_BVEC down. For > user-backed iterators it has to be done this way because the I/O may get > shuffled off to a different thread.
For sub-page sided transfers it is probably worth doing a bounce buffer copy of user requests - just to save all the complex page pinning code.
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |