From: Christoph Hellwig <hch@infradead.org>
To: Joe Damato <jdamato@fastly.com>,
Christoph Hellwig <hch@infradead.org>,
Jens Axboe <axboe@kernel.dk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
asml.silence@gmail.com, linux-fsdevel@vger.kernel.org,
edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
linux-api@vger.kernel.org, linux-arch@vger.kernel.org,
viro@zeniv.linux.org.uk, jack@suse.cz, kuba@kernel.org,
shuah@kernel.org, sdf@fomichev.me, mingo@redhat.com,
arnd@arndb.de, brauner@kernel.org, akpm@linux-foundation.org,
tglx@linutronix.de, jolsa@kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [RFC -next 00/10] Add ZC notifications to splice and sendfile
Date: Thu, 20 Mar 2025 22:56:15 -0700 [thread overview]
Message-ID: <Z9z_f-kR0lBx8P_9@infradead.org> (raw)
In-Reply-To: <Z9xdPVQeLBrB-Anu@LQ3V64L9R2>
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.
It also doesn't help that more than 7 years after adding it,
SO_ZEROCOPY is still completely undocumented.
> > 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.
> It seems like Jens suggested that plumbing this through for splice
> was a possibility, but sounds like you disagree.
Yes, very strongly.
> 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.
next prev parent reply other threads:[~2025-03-21 5:56 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 0:15 [RFC -next 00/10] Add ZC notifications to splice and sendfile Joe Damato
2025-03-19 0:15 ` [RFC -next 01/10] splice: Add ubuf_info to prepare for ZC Joe Damato
2025-03-19 0:15 ` [RFC -next 02/10] splice: Add helper that passes through splice_desc Joe Damato
2025-03-19 0:15 ` [RFC -next 03/10] splice: Factor splice_socket into a helper Joe Damato
2025-03-19 0:15 ` [RFC -next 04/10] splice: Add SPLICE_F_ZC and attach ubuf Joe Damato
2025-03-19 0:15 ` [RFC -next 05/10] fs: Add splice_write_sd to file operations Joe Damato
2025-03-19 0:15 ` [RFC -next 06/10] fs: Extend do_sendfile to take a flags argument Joe Damato
2025-03-19 0:15 ` [RFC -next 07/10] fs: Add sendfile2 which accepts " Joe Damato
2025-03-19 0:15 ` [RFC -next 08/10] fs: Add sendfile flags for sendfile2 Joe Damato
2025-03-19 0:15 ` [RFC -next 09/10] fs: Add sendfile2 syscall Joe Damato
2025-03-19 0:15 ` [RFC -next 10/10] selftests: Add sendfile zerocopy notification test Joe Damato
2025-03-19 8:04 ` [RFC -next 00/10] Add ZC notifications to splice and sendfile Christoph Hellwig
2025-03-19 15:32 ` Joe Damato
2025-03-19 16:07 ` Jens Axboe
2025-03-19 17:04 ` Joe Damato
2025-03-19 17:20 ` Jens Axboe
2025-03-19 17:45 ` Joe Damato
2025-03-19 18:37 ` Jens Axboe
2025-03-19 19:15 ` Stefan Metzmacher
2025-03-20 10:46 ` Pavel Begunkov
2025-03-21 7:55 ` Stefan Metzmacher
2025-03-21 20:51 ` Pavel Begunkov
2025-03-19 19:16 ` Joe Damato
2025-03-21 11:11 ` Jens Axboe
2025-03-20 5:57 ` Christoph Hellwig
2025-03-20 18:23 ` Joe Damato
2025-03-21 5:56 ` Christoph Hellwig [this message]
2025-03-21 11:14 ` Jens Axboe
2025-03-21 16:36 ` Joe Damato
2025-03-21 20:30 ` Joe Damato
2025-03-21 20:33 ` Jens Axboe
2025-03-21 21:28 ` Joe Damato
2025-03-21 20:35 ` Jens Axboe
2025-03-21 16:44 ` Joe Damato
2025-03-19 23:22 ` Joe Damato
2025-03-21 11:13 ` Jens Axboe
2025-03-20 5:50 ` Christoph Hellwig
2025-03-20 18:05 ` Joe Damato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9z_f-kR0lBx8P_9@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jack@suse.cz \
--cc=jdamato@fastly.com \
--cc=jolsa@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).