Thread (64 messages) 64 messages, 10 authors, 2023-02-20

Re: copy on write for splice() from file to pipe?

flat view

From: Jens Axboe <axboe@kernel.dk>
Date: 2023-02-10 22:16:52
Also in: io-uring, linux-fsdevel, lkml

On 2/10/23 3:08?PM, Linus Torvalds wrote:
On Fri, Feb 10, 2023 at 1:51 PM Jens Axboe [off-list ref] wrote:
quoted
Speaking of splice/io_uring, Ming posted this today:

https://lore.kernel.org/io-uring/20230210153212.733006-1-ming.lei@redhat.com/ (local)
Ugh. Some of that is really ugly. Both 'ignore_sig' and
'ack_page_consuming' just look wrong. Pure random special cases.

And that 'ignore_sig' is particularly ugly, since the only thing that
sets it also sets SPLICE_F_NONBLOCK.

And the *only* thing that actually then checks that field is
'splice_from_pipe_next()', where there are exactly two
signal_pending() checks that it adds to, and

 (a) the first one is to protect from endless loops

 (b) the second one is irrelevant when  SPLICE_F_NONBLOCK is set

So honestly, just NAK on that series.

I think that instead of 'ignore_sig' (which shouldn't exist), that
first 'signal_pending()' check in splice_from_pipe_next() should just
be changed into a 'fatal_signal_pending()'.

But that 'ack_page_consuming' thing looks even more disgusting, and
since I'm not sure why it even exists, I don't know what it's doing
wrong.

Let's agree not to make splice() worse, while people are talking about
how bad it already is, ok?
I was in no way advocating for this series, but it seems relevant as we
are discussing splice :-). I have pointed Ming at this discussion too.

-- 
Jens Axboe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help