Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile

Joe Damato
2025-03-21T16:44:17Z

On Thu, Mar 20, 2025 at 10:56:15PM -0700, Christoph Hellwig wrote:
> On Thu, Mar 20, 2025 at 11:23:57AM -0700, Joe Damato wrote:
> > In my other message to Jens I proposed:
> > - SPLICE_F_ZC for splice to generate zc completion notifications
> > to the error queue
> > - Modifying sendfile so that if SO_ZEROCOPY (which already exists)
> > is set on a network socket, zc completion notifications are
> > generated.
> >
> > In both cases no new system call is needed and both splice and
> > sendfile become safer to use.
> >
> > At some point in the future a mechanism built on top of iouring
> > introduced as new system calls (sendmsg2, sendfile2, splice2, etc)
> > can be built.
>
> I strongly disagree with this. This is spreading the broken
> SO_ZEROCOPY to futher places outside the pure networking realm. Don't
> do that.

OK. I won't proceed down that path. Thank you for the feedback.

> > > Because sendmsg should never have done that it certainly should not
> > > spread beyond purely socket specific syscalls.
> >
> > I don't know the entire historical context, but I presume sendmsg
> > did that because there was no other mechanism at the time.
>
> At least aio had been around for about 15 years at the point, but
> networking folks tend to be pretty insular and reinvent things.

Sorry, but whatever issue there is between networking and other
folks is well beyond my understanding and historical context. I'm
not a reviewer or maintainer or anything like that; I'm just a
developer who saw a problem and wanted a solution.

I've read your message loud and clear, though, and I won't proceed
down the path I've proposed.

I appreciate your feedback; this is precisely why I sent the RFC -
to get comments - so thank you for taking a look and letting me
know.

> > As mentioned above and in other messages, it seems like it is
> > possible to improve the networking parts of splice (and therefore
> > sendfile) to make them safer to use without introducing a new system
> > call.
> >
> > Are you saying that you are against doing that, even if the code is
> > network specific (but lives in fs/)?
>
> Yes.
>
> Please take the work and integrate it with the kiocb-based system
> we use for all other in-kernel I/O that needs completion notifications
> and which makes it trivial to integate with io_uring instead of
> spreading an imcompatible and inferior event system.

If you have any suggestions or pointers to code I should look at for
inspiration I would very much appreciate the guidance.

Thanks for your time and energy in reviewing my RFC and responding.

- Joe