On Tue, Oct 18, 2022 at 03:29:42PM +0100, David Howells wrote: > Note that iov_iter_get_pages2() doesn't handle KVEC-class iterators, which > this code does - for kmalloc'd, vmalloc'd and vmap'd memory and for global and > stack variables. What I've written gets the physical addresses but > doesn't/can't pin it (which probably means I can't just move my code into > iov_iter_get_pages2()). Please look at the long discussion on Ira's patches for iov_iter_pin_pages where we went through this over and over again. We need to handle all of these in the common helper. > Further, my code also treats multipage folios as single units which > iov_iter_get_pages2() also doesn't - at least from XARRAY-class iterators. > > The UBUF-/IOVEC-extraction code doesn't handle multipage folios because > get_user_pages_fast() doesn't - though perhaps it will need to at some point. Yes, we need to be smarter about folios. But that is nothing magic about network file systems. I have old patches that added a (barely working) variant of get_user_pages_fast that exported bio_vecs and I think willy planned to look into a folio based version of get/pin user pages. But one thing at a time. I think the work from Ira to switch to proper pinning and sort out the weirdnesses for non-users buffer types is the first priority. After that proper folio or large contiguous range support is another item. But none of that is helped by parallel infrastructure.