On Wed, Feb 08, 2023 at 04:09:51PM +0000, David Howells wrote: > How about one of two different solutions? > > (1) Repurpose the function I proposed for generic_file_splice_read() but only > for splicing from O_DIRECT files; reading from non-O_DIRECT files would > use an ITER_PIPE as upstream. Given the amounts of problems we had with O_DIRECT vs splice, and the fact that even doing this is a bit pointless that seems sensible to me. > for splicing from O_DIRECT files, as (1), but also replace the splice > from a buffered file with something like the patch below. This uses > filemap_get_pages() to do the reading and to get a bunch of folios from > the pagecache that we can then splice into the pipe directly. I defintively like the idea of killing ITER_PIPE. Isn't the 16 folios in a folio tree often much less than what we could fit into a single pipe buf? Unless you have a file system that can use huge folios for buffered I/O and actually does this might significantly limit performance. With that in mind I'll try to find some time to review your actual patch, but I'm a little busy at the moment.