Re: [PATCH 0/3] vmsplice: make vmsplice a trivial wrapper for preadv2/pwritev2
From: Pedro Falcato
Date: Wed Jun 03 2026 - 07:45:09 EST
On Tue, Jun 02, 2026 at 08:51:03PM -0700, Andy Lutomirski wrote:
> On Tue, Jun 2, 2026 at 5:12 PM Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Tue, 2 Jun 2026 at 15:54, Askar Safin <safinaskar@xxxxxxxxx> wrote:
> > >
> > > Pedro is talking here not about this vmsplice patch, but about
> > > my future hypothetical patch, which will remove splice-pagecache-to-pipe.
> >
> > That absolutely would be my suggested next step.
> >
> > Something like the attached - get rid of filemap_splice_read()
> > entirely, and just replace it with copy_splice_read().
>
> Am I understanding correctly that this will completely break zerocopy
> sendfile? sendfile is, internally, splice-to-a-secret-per-task-pipe
> and then splice to the socket. How much to people care? These days,
> a lot of high-bandwidth network senders are sending encrypted data,
> which is not zerocopy frompagecache. But there are surely some users
You can do zerocopy from the page cache, even with TLS on top, by having
your (fancy) NIC do TLS offloading for you. See https://people.freebsd.org/~gallatin/talks/euro2019-ktls.pdf.
Linux works similarly. Slide 26 is particularly interesting.
(No KTLS I assume is using simple sendmsg()'s from user memory, SW TLS
and NIC KTLS are both sendfile(), per the slides)
TL;DR I really do think it matters.
>
> Now maybe someone cares about a different path? Splice from socket to
> pipe to file? Splice from socket to pipe to other socket? Does
> anyone do any of this? One can, of course, recv() directly to an
> mmapped file, but then you pay for page faults, so that probably a bad
> idea in most cases. At least all of these cases don't have spliced
> buffers that refer to a potentially read-only file.
>
>
> But I'm a little concerned that zerocopy sends from files to network
> are actually important.
>
> --Andy
--
Pedro