* [PATCH RERESEND 01/11] splice: copy_splice_read: do the I/O with IOCB_NOWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
@ 2023-12-14 18:44 ` Ahelenia Ziemiańska
2023-12-14 18:44 ` [PATCH RERESEND 02/11] af_unix: unix_stream_splice_read: always request MSG_DONTWAIT Ahelenia Ziemiańska
` (10 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:44 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 748 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
fs/splice.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/splice.c b/fs/splice.c
index d983d375ff11..9d29664f23ee 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -361,6 +361,7 @@ ssize_t copy_splice_read(struct file *in, loff_t *ppos,
iov_iter_bvec(&to, ITER_DEST, bv, npages, len);
init_sync_kiocb(&kiocb, in);
kiocb.ki_pos = *ppos;
+ kiocb.ki_flags |= IOCB_NOWAIT;
ret = call_read_iter(in, &kiocb, &to);
if (ret > 0) {
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 02/11] af_unix: unix_stream_splice_read: always request MSG_DONTWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
2023-12-14 18:44 ` [PATCH RERESEND 01/11] splice: copy_splice_read: do the I/O with IOCB_NOWAIT Ahelenia Ziemiańska
@ 2023-12-14 18:44 ` Ahelenia Ziemiańska
2023-12-14 18:44 ` [PATCH RERESEND 03/11] fuse: fuse_dev_splice_read: use nonblocking I/O Ahelenia Ziemiańska
` (9 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:44 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Kuniyuki Iwashima, David Howells, Alexander Mikhalitsyn,
Kirill Tkhai, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 937 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/unix/af_unix.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 3e8a04a13668..9489b9bda753 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2889,15 +2889,12 @@ static ssize_t unix_stream_splice_read(struct socket *sock, loff_t *ppos,
.pipe = pipe,
.size = size,
.splice_flags = flags,
+ .flags = MSG_DONTWAIT,
};
if (unlikely(*ppos))
return -ESPIPE;
- if (sock->file->f_flags & O_NONBLOCK ||
- flags & SPLICE_F_NONBLOCK)
- state.flags = MSG_DONTWAIT;
-
return unix_stream_read_generic(&state, false);
}
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 03/11] fuse: fuse_dev_splice_read: use nonblocking I/O
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
2023-12-14 18:44 ` [PATCH RERESEND 01/11] splice: copy_splice_read: do the I/O with IOCB_NOWAIT Ahelenia Ziemiańska
2023-12-14 18:44 ` [PATCH RERESEND 02/11] af_unix: unix_stream_splice_read: always request MSG_DONTWAIT Ahelenia Ziemiańska
@ 2023-12-14 18:44 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 04/11] tracing: tracing_buffers_splice_read: behave as-if non-blocking I/O Ahelenia Ziemiańska
` (8 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:44 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Miklos Szeredi, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
fs/fuse/dev.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 1a8f82f478cb..4e8caf66c01e 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1202,7 +1202,8 @@ __releases(fiq->lock)
* the 'sent' flag.
*/
static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file,
- struct fuse_copy_state *cs, size_t nbytes)
+ struct fuse_copy_state *cs, size_t nbytes,
+ bool nonblock)
{
ssize_t err;
struct fuse_conn *fc = fud->fc;
@@ -1238,7 +1239,7 @@ static ssize_t fuse_dev_do_read(struct fuse_dev *fud, struct file *file,
break;
spin_unlock(&fiq->lock);
- if (file->f_flags & O_NONBLOCK)
+ if (nonblock)
return -EAGAIN;
err = wait_event_interruptible_exclusive(fiq->waitq,
!fiq->connected || request_pending(fiq));
@@ -1364,7 +1365,8 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, struct iov_iter *to)
fuse_copy_init(&cs, 1, to);
- return fuse_dev_do_read(fud, file, &cs, iov_iter_count(to));
+ return fuse_dev_do_read(fud, file, &cs, iov_iter_count(to),
+ file->f_flags & O_NONBLOCK);
}
static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
@@ -1388,7 +1390,7 @@ static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
fuse_copy_init(&cs, 1, NULL);
cs.pipebufs = bufs;
cs.pipe = pipe;
- ret = fuse_dev_do_read(fud, in, &cs, len);
+ ret = fuse_dev_do_read(fud, in, &cs, len, true);
if (ret < 0)
goto out;
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 04/11] tracing: tracing_buffers_splice_read: behave as-if non-blocking I/O
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (2 preceding siblings ...)
2023-12-14 18:44 ` [PATCH RERESEND 03/11] fuse: fuse_dev_splice_read: use nonblocking I/O Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-20 16:41 ` Steven Rostedt
2023-12-14 18:45 ` [PATCH RERESEND 05/11] relayfs: relay_file_splice_read: always return -EAGAIN for no data Ahelenia Ziemiańska
` (7 subsequent siblings)
11 siblings, 1 reply; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Steven Rostedt, Masami Hiramatsu, linux-kernel,
linux-trace-kernel
[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
kernel/trace/trace.c | 32 ++++----------------------------
1 file changed, 4 insertions(+), 28 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index abaaf516fcae..9be7a4c0a3ca 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8477,7 +8477,6 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
if (splice_grow_spd(pipe, &spd))
return -ENOMEM;
- again:
trace_access_lock(iter->cpu_file);
entries = ring_buffer_entries_cpu(iter->array_buffer->buffer, iter->cpu_file);
@@ -8528,35 +8527,12 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,
/* did we read anything? */
if (!spd.nr_pages) {
- long wait_index;
-
- if (ret)
- goto out;
-
- ret = -EAGAIN;
- if ((file->f_flags & O_NONBLOCK) || (flags & SPLICE_F_NONBLOCK))
- goto out;
-
- wait_index = READ_ONCE(iter->wait_index);
-
- ret = wait_on_pipe(iter, iter->tr->buffer_percent);
- if (ret)
- goto out;
-
- /* No need to wait after waking up when tracing is off */
- if (!tracer_tracing_is_on(iter->tr))
- goto out;
-
- /* Make sure we see the new wait_index */
- smp_rmb();
- if (wait_index != iter->wait_index)
- goto out;
-
- goto again;
+ if (!ret)
+ ret = -EAGAIN;
+ } else {
+ ret = splice_to_pipe(pipe, &spd);
}
- ret = splice_to_pipe(pipe, &spd);
-out:
splice_shrink_spd(&spd);
return ret;
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 05/11] relayfs: relay_file_splice_read: always return -EAGAIN for no data
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (3 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 04/11] tracing: tracing_buffers_splice_read: behave as-if non-blocking I/O Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 06/11] net/smc: smc_splice_read: always request MSG_DONTWAIT Ahelenia Ziemiańska
` (6 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Andrew Morton, Hyeonggon Yoo, Liam R. Howlett, Pengcheng Yang,
Zhang Zhengming, Xu Panda, Li kunyu, Gavrilov Ilia,
Suren Baghdasaryan, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 600 bytes --]
For consistency with the new "file->pipe reads non-blockingly" semantic.
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
kernel/relay.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/relay.c b/kernel/relay.c
index 83fe0325cde1..3d381e94a204 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1215,8 +1215,7 @@ static ssize_t relay_file_splice_read(struct file *in,
if (ret < 0)
break;
else if (!ret) {
- if (flags & SPLICE_F_NONBLOCK)
- ret = -EAGAIN;
+ ret = -EAGAIN;
break;
}
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 06/11] net/smc: smc_splice_read: always request MSG_DONTWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (4 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 05/11] relayfs: relay_file_splice_read: always return -EAGAIN for no data Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 07/11] kcm: kcm_splice_read: " Ahelenia Ziemiańska
` (5 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Karsten Graul, Wenjia Zhang, Jan Karcher, D. Wythe, Tony Lu,
Wen Gu, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-s390, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 912 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/smc/af_smc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index bacdd971615e..89473305f629 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -3243,12 +3243,8 @@ static ssize_t smc_splice_read(struct socket *sock, loff_t *ppos,
rc = -ESPIPE;
goto out;
}
- if (flags & SPLICE_F_NONBLOCK)
- flags = MSG_DONTWAIT;
- else
- flags = 0;
SMC_STAT_INC(smc, splice_cnt);
- rc = smc_rx_recvmsg(smc, NULL, pipe, len, flags);
+ rc = smc_rx_recvmsg(smc, NULL, pipe, len, MSG_DONTWAIT);
}
out:
release_sock(sk);
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 07/11] kcm: kcm_splice_read: always request MSG_DONTWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (5 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 06/11] net/smc: smc_splice_read: always request MSG_DONTWAIT Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 08/11] tls/sw: tls_sw_splice_read: always request non-blocking I/O Ahelenia Ziemiańska
` (4 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Howells, Shigeru Yoshida, Kuniyuki Iwashima, Cong Wang,
netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 948 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Also: don't pass the SPLICE_F_*-style flags argument to
skb_recv_datagram(), which expects MSG_*-style flags.
This fixes SPLICE_F_NONBLOCK not having worked.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/kcm/kcmsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index dd1d8ffd5f59..de70156869e6 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1028,7 +1028,7 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos,
/* Only support splice for SOCKSEQPACKET */
- skb = skb_recv_datagram(sk, flags, &err);
+ skb = skb_recv_datagram(sk, MSG_DONTWAIT, &err);
if (!skb)
goto err_out;
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 08/11] tls/sw: tls_sw_splice_read: always request non-blocking I/O
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (6 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 07/11] kcm: kcm_splice_read: " Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 09/11] net/tcp: tcp_splice_read: always do non-blocking reads Ahelenia Ziemiańska
` (3 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Boris Pismenny, John Fastabend, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1084 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/tls/tls_sw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index d1fc295b83b5..73d88c6739e8 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -2145,7 +2145,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
int chunk;
int err;
- err = tls_rx_reader_lock(sk, ctx, flags & SPLICE_F_NONBLOCK);
+ err = tls_rx_reader_lock(sk, ctx, true);
if (err < 0)
return err;
@@ -2154,8 +2154,7 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
} else {
struct tls_decrypt_arg darg;
- err = tls_rx_rec_wait(sk, NULL, flags & SPLICE_F_NONBLOCK,
- true);
+ err = tls_rx_rec_wait(sk, NULL, true, true);
if (err <= 0)
goto splice_read_end;
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 09/11] net/tcp: tcp_splice_read: always do non-blocking reads
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (7 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 08/11] tls/sw: tls_sw_splice_read: always request non-blocking I/O Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 18:45 ` [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT Ahelenia Ziemiańska
` (2 subsequent siblings)
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
Eric Dumazet, David S. Miller, David Ahern, Jakub Kicinski,
Paolo Abeni, netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
sock_rcvtimeo() returns 0 if the second argument is true, so the
explicit re-try loop for empty read conditions can be removed
entirely.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
net/ipv4/tcp.c | 30 +++---------------------------
1 file changed, 3 insertions(+), 27 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 3f66cdeef7de..09b562e2c1bf 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -782,7 +782,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
.len = len,
.flags = flags,
};
- long timeo;
ssize_t spliced;
int ret;
@@ -797,7 +796,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
lock_sock(sk);
- timeo = sock_rcvtimeo(sk, sock->file->f_flags & O_NONBLOCK);
while (tss.len) {
ret = __tcp_splice_read(sk, &tss);
if (ret < 0)
@@ -821,35 +819,13 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
ret = -ENOTCONN;
break;
}
- if (!timeo) {
- ret = -EAGAIN;
- break;
- }
- /* if __tcp_splice_read() got nothing while we have
- * an skb in receive queue, we do not want to loop.
- * This might happen with URG data.
- */
- if (!skb_queue_empty(&sk->sk_receive_queue))
- break;
- sk_wait_data(sk, &timeo, NULL);
- if (signal_pending(current)) {
- ret = sock_intr_errno(timeo);
- break;
- }
- continue;
+ ret = -EAGAIN;
+ break;
}
tss.len -= ret;
spliced += ret;
- if (!tss.len || !timeo)
- break;
- release_sock(sk);
- lock_sock(sk);
-
- if (sk->sk_err || sk->sk_state == TCP_CLOSE ||
- (sk->sk_shutdown & RCV_SHUTDOWN) ||
- signal_pending(current))
- break;
+ break;
}
release_sock(sk);
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (8 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 09/11] net/tcp: tcp_splice_read: always do non-blocking reads Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-15 15:47 ` Jens Axboe
2023-12-14 18:45 ` [PATCH RERESEND 11/11] splice: splice_to_socket: always request MSG_DONTWAIT Ahelenia Ziemiańska
2023-12-14 19:06 ` [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Jens Axboe
11 siblings, 1 reply; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]
We request non-blocking I/O in the generic implementation, but some
files ‒ ttys ‒ only check O_NONBLOCK. Refuse them here, lest we
risk sleeping with the pipe locked for indeterminate lengths of
time.
This also masks inconsistent wake-ups (usually every second line)
when splicing from ttys in icanon mode.
Regular files don't /have/ a distinct O_NONBLOCK mode,
because they always behave non-blockingly, and for them FMODE_NOWAIT is
used in the purest sense of
/* File is capable of returning -EAGAIN if I/O will block */
which is not set by the vast majority of filesystems,
and it's not the semantic we want here.
Link: https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
fs/splice.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/splice.c b/fs/splice.c
index 9d29664f23ee..81788bf7daa1 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1300,6 +1300,8 @@ long do_splice(struct file *in, loff_t *off_in, struct file *out,
} else if (opipe) {
if (off_out)
return -ESPIPE;
+ if (!((in->f_mode & FMODE_NOWAIT) || S_ISREG(in->f_inode->i_mode)))
+ return -EINVAL;
if (off_in) {
if (!(in->f_mode & FMODE_PREAD))
return -EINVAL;
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT
2023-12-14 18:45 ` [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT Ahelenia Ziemiańska
@ 2023-12-15 15:47 ` Jens Axboe
2023-12-16 5:36 ` Ahelenia Ziemiańska
0 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2023-12-15 15:47 UTC (permalink / raw)
To: Ahelenia Ziemiańska
Cc: Christian Brauner, Alexander Viro, linux-fsdevel, linux-kernel
On 12/14/23 11:45 AM, Ahelenia Ziemia?ska wrote:
> We request non-blocking I/O in the generic implementation, but some
> files ? ttys ? only check O_NONBLOCK. Refuse them here, lest we
> risk sleeping with the pipe locked for indeterminate lengths of
> time.
A worthy goal here is ensuring that _everybody_ honors IOCB_NOWAIT,
rather than just rely on O_NONBLOCK. This does involve converting to
->read_iter/->write_iter if the driver isn't already using it, but some
of them already have that, yet don't check IOCB_NOWAIT or treat it the
same as O_NONBLOCK.
Adding special checks like this is not a good idea, imho.
> This also masks inconsistent wake-ups (usually every second line)
> when splicing from ttys in icanon mode.
>
> Regular files don't /have/ a distinct O_NONBLOCK mode,
> because they always behave non-blockingly, and for them FMODE_NOWAIT is
> used in the purest sense of
> /* File is capable of returning -EAGAIN if I/O will block */
> which is not set by the vast majority of filesystems,
> and it's not the semantic we want here.
The main file systems do very much set it, like btrfs, ext4, and xfs. If
you look at total_file_systems / ones_flagging_it the ratio may be high,
but in terms of installed userbase, the majority definitely will have
it. Also see comment on cover letter for addressing this IOCB_NOWAIT
confusion.
--
Jens Axboe
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT
2023-12-15 15:47 ` Jens Axboe
@ 2023-12-16 5:36 ` Ahelenia Ziemiańska
0 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-16 5:36 UTC (permalink / raw)
To: Jens Axboe; +Cc: Christian Brauner, Alexander Viro, linux-fsdevel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5389 bytes --]
On Fri, Dec 15, 2023 at 08:47:15AM -0700, Jens Axboe wrote:
> On 12/14/23 11:45 AM, Ahelenia Ziemiańska wrote:
> > We request non-blocking I/O in the generic implementation, but some
> > files ‒ ttys ‒ only check O_NONBLOCK. Refuse them here, lest we
> > risk sleeping with the pipe locked for indeterminate lengths of
> > time.
> A worthy goal here is ensuring that _everybody_ honors IOCB_NOWAIT,
> rather than just rely on O_NONBLOCK. This does involve converting to
> ->read_iter/->write_iter if the driver isn't already using it, but some
> of them already have that, yet don't check IOCB_NOWAIT or treat it the
> same as O_NONBLOCK.
This doesn't really mean much to me, sorry.
> Adding special checks like this is not a good idea, imho.
That's what Linus said I should do so that's what I did
https://lore.kernel.org/linux-fsdevel/CAHk-=wimmqG_wvSRtMiKPeGGDL816n65u=Mq2+H3-=uM2U6FmA@mail.gmail.com/
I can't fix the tty layer :/
> > This also masks inconsistent wake-ups (usually every second line)
> > when splicing from ttys in icanon mode.
> >
> > Regular files don't /have/ a distinct O_NONBLOCK mode,
> > because they always behave non-blockingly, and for them FMODE_NOWAIT is
> > used in the purest sense of
> > /* File is capable of returning -EAGAIN if I/O will block */
> > which is not set by the vast majority of filesystems,
> > and it's not the semantic we want here.
>
> The main file systems do very much set it, like btrfs, ext4, and xfs. If
> you look at total_file_systems / ones_flagging_it the ratio may be high,
> but in terms of installed userbase, the majority definitely will have
> it. Also see comment on cover letter for addressing this IOCB_NOWAIT
> confusion.
Reassessing
[1] https://lore.kernel.org/linux-fsdevel/5osglsw36dla3mubtpsmdwdid4fsdacplyd6acx2igo4atogdg@yur3idyim3cc/
I see FMODE_NOWAIT in
blockdevs
/dev/{null,zero,random,urandom}
btrfs/ext4/f2fs/ocfs2/xfs
eventfd
pipes
sockets
tun/tap
which means that vfat/fuse/nfs/tmpfs/ramfs/procfs/sysfs don't.
(zfs also doesn't, but that's not for this list.)
I don't know if that's actually a "majority" in a meaningful sense,
I agree, but I think I primarily committed to this exclusion because
tmpfs/ramfs didn't.
I s'pose ramfs can already be tagged since it already returns
-EAGAIN when I/O would block (never).
tmpfs not being spliceable is also questionable.
But this'd also mean effectively deleting
afs_file_splice_read
ceph_splice_read
coda_file_splice_read
ecryptfs_splice_read_update_atime
fuse_dev_splice_read
nfs_file_splice_read
orangefs_file_splice_read
shmem_file_splice_read
v9fs_file_splice_read
(not to mention the many others (adfs/affs/bfs/bcachefs/cramfs/erofs/fat/hfs*/hostfs/hpfs/jffs2/jfs/minix/nilfs/ntfs/omfs/reiserfs/isofs/sysv/ubifs/udf/ufs/vboxsf/squashfs/romfs)
which just use the filemap impl verbatim).
There's no point to restricting splice access on a per-filesystem level
(which this'd do), since to mount a malicious network filesystem you
need to be root.
A denial of service attack makes no sense if you're already root.
(Maybe except for fuse, which people typically run suid;
that I could see potentially making sense to disable..)
I have indeed managed to confuse myself into the NOWAIT hole,
but this is actually about
"not letting unprivileged users escalate into
hanging system daemons by writing to a pipe"
rather than
"if we ever hold the pipe lock for >2µs we die instantly".
O_NONBLOCK filtered by FMODE_NOWAIT is used as a semantic proxy for
the 10 different types of files anyone can create that we know are safe.
Anyone can open a socket and not write to it, so we must refuse to
splice from a socket with no data in it.
But only root can mount filesystems, so a regular file is always safe.
And, actually defining a slightly-heuristic per-file policy in the syscall
itself is stupid, you've talked me out of this.
This check only actually applies to the generic copy_splice_read()
implementation, since the "real"/non-generic splices
(fiemap_splice_read/per-filesystem ‒
all the others that this patchset touches)
are already known to be safe
(and aren't reads so FMODE_NOWAIT doesn't factor in at all).
I've dropped this patch and have instead added this to 01/11:
diff --git a/fs/splice.c b/fs/splice.c
index f8bfc9cf8cdc..6d369d7d56d5 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -331,0 +332,7 @@ ssize_t copy_splice_read(struct file *in, loff_t *ppos,
+ /*
+ * This generic implementation is only safe w.r.t. the pipe lock
+ * if the file actually respects IOCB_NOWAIT, which ttys don't.
+ */
+ if (!(in->f_mode & FMODE_NOWAIT))
+ return -EINVAL;
(Indeed, in many ways, Linus' post to which I reply in [1] pretty much
says this explcitly. Actually he literally says this. I just don't
realise and instead of adding the snippet to copy_splice_read(),
which he already diffed and talks about, I copied it to the syscall.)
Now I just need to re-consider the prose in a way
that avoids this deeply embarrassing IOCB_NOWAIT/regular-file nonsense,
and this series ends up being just "fixing splice implementations"
without also special-casing the syscall itself.
Thanks for asking the right questions.
Sorry for longposting.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH RERESEND 11/11] splice: splice_to_socket: always request MSG_DONTWAIT
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (9 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 10/11] splice: file->pipe: -EINVAL for non-regular files w/o FMODE_NOWAIT Ahelenia Ziemiańska
@ 2023-12-14 18:45 ` Ahelenia Ziemiańska
2023-12-14 19:06 ` [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Jens Axboe
11 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 18:45 UTC (permalink / raw)
Cc: Jens Axboe, Christian Brauner, Alexander Viro, linux-fsdevel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
Otherwise we risk sleeping with the pipe locked for indeterminate
lengths of time.
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
fs/splice.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/fs/splice.c b/fs/splice.c
index 81788bf7daa1..d5885032f9a8 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -869,13 +869,11 @@ ssize_t splice_to_socket(struct pipe_inode_info *pipe, struct file *out,
if (!bc)
break;
- msg.msg_flags = MSG_SPLICE_PAGES;
+ msg.msg_flags = MSG_SPLICE_PAGES | MSG_DONTWAIT;
if (flags & SPLICE_F_MORE)
msg.msg_flags |= MSG_MORE;
if (remain && pipe_occupancy(pipe->head, tail) > 0)
msg.msg_flags |= MSG_MORE;
- if (out->f_flags & O_NONBLOCK)
- msg.msg_flags |= MSG_DONTWAIT;
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, bvec, bc,
len - remain);
--
2.39.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK
2023-12-14 18:44 [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Ahelenia Ziemiańska
` (10 preceding siblings ...)
2023-12-14 18:45 ` [PATCH RERESEND 11/11] splice: splice_to_socket: always request MSG_DONTWAIT Ahelenia Ziemiańska
@ 2023-12-14 19:06 ` Jens Axboe
2023-12-14 20:14 ` Ahelenia Ziemiańska
11 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2023-12-14 19:06 UTC (permalink / raw)
To: Ahelenia Ziemiańska
Cc: Christian Brauner, Alexander Viro, linux-fsdevel, D. Wythe,
David S. Miller, Liam R. Howlett, Alexander Mikhalitsyn,
Andrew Morton, Boris Pismenny, Cong Wang, David Ahern,
David Howells, Eric Dumazet, Gavrilov Ilia, Hyeonggon Yoo,
Jakub Kicinski, Jan Karcher, John Fastabend, Karsten Graul,
Kirill Tkhai, Kuniyuki Iwashima, Li kunyu, linux-kernel,
linux-s390, netdev, linux-trace-kernel, Masami Hiramatsu,
Miklos Szeredi, Paolo Abeni, Pengcheng Yang, Shigeru Yoshida,
Steven Rostedt, Suren Baghdasaryan, Tony Lu, Wen Gu, Wenjia Zhang,
Xu Panda, Zhang Zhengming
On 12/14/23 11:44 AM, Ahelenia Ziemia?ska wrote:
> First: https://lore.kernel.org/lkml/cover.1697486714.git.nabijaczleweli@nabijaczleweli.xyz/t/#u
> Resend: https://lore.kernel.org/lkml/1cover.1697486714.git.nabijaczleweli@nabijaczleweli.xyz/t/#u
> Resending again per https://lore.kernel.org/lkml/20231214093859.01f6e2cd@kernel.org/t/#u
>
> Hi!
>
> As it stands, splice(file -> pipe):
> 1. locks the pipe,
> 2. does a read from the file,
> 3. unlocks the pipe.
>
> For reading from regular files and blcokdevs this makes no difference.
> But if the file is a tty or a socket, for example, this means that until
> data appears, which it may never do, every process trying to read from
> or open the pipe enters an uninterruptible sleep,
> and will only exit it if the splicing process is killed.
>
> This trivially denies service to:
> * any hypothetical pipe-based log collexion system
> * all nullmailer installations
> * me, personally, when I'm pasting stuff into qemu -serial chardev:pipe
>
> This follows:
> 1. https://lore.kernel.org/linux-fsdevel/qk6hjuam54khlaikf2ssom6custxf5is2ekkaequf4hvode3ls@zgf7j5j4ubvw/t/#u
> 2. a security@ thread rooted in
> <irrrblivicfc7o3lfq7yjm2lrxq35iyya4gyozlohw24gdzyg7@azmluufpdfvu>
> 3. https://nabijaczleweli.xyz/content/blogn_t/011-linux-splice-exclusion.html
>
> Patches were posted and then discarded on principle or funxionality,
> all in all terminating in Linus posting
>> But it is possible that we need to just bite the bullet and say
>> "copy_splice_read() needs to use a non-blocking kiocb for the IO".
>
> This does that, effectively making splice(file -> pipe)
> request (and require) O_NONBLOCK on reads fron the file:
> this doesn't affect splicing from regular files and blockdevs,
> since they're always non-blocking
> (and requesting the stronger "no kernel sleep" IOCB_NOWAIT is non-sensical),
Not sure how you got the idea that regular files or block devices is
always non-blocking, this is certainly not true without IOCB_NOWAIT.
Without IOCB_NOWAIT, you can certainly be waiting for previous IO to
complete.
> but always returns -EINVAL for ttys.
> Sockets behave as expected from O_NONBLOCK reads:
> splice if there's data available else -EAGAIN.
>
> This should all pretty much behave as-expected.
Should it? Seems like there's a very high risk of breaking existing use
cases here.
Have you at all looked into the approach of enabling splice to/from
_without_ holding the pipe lock? That, to me, would seem like a much
saner approach, with the caveat that I have not looked into that at all
so there may indeed be reasons why this is not feasible.
--
Jens Axboe
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK
2023-12-14 19:06 ` [PATCH RERESEND 00/11] splice(file<>pipe) I/O on file as-if O_NONBLOCK Jens Axboe
@ 2023-12-14 20:14 ` Ahelenia Ziemiańska
0 siblings, 0 replies; 17+ messages in thread
From: Ahelenia Ziemiańska @ 2023-12-14 20:14 UTC (permalink / raw)
To: Jens Axboe
Cc: Christian Brauner, Alexander Viro, linux-fsdevel, D. Wythe,
David S. Miller, Liam R. Howlett, Alexander Mikhalitsyn,
Andrew Morton, Boris Pismenny, Cong Wang, David Ahern,
David Howells, Eric Dumazet, Gavrilov Ilia, Hyeonggon Yoo,
Jakub Kicinski, Jan Karcher, John Fastabend, Karsten Graul,
Kirill Tkhai, Kuniyuki Iwashima, Li kunyu, linux-kernel,
linux-s390, netdev, linux-trace-kernel, Masami Hiramatsu,
Miklos Szeredi, Paolo Abeni, Pengcheng Yang, Shigeru Yoshida,
Steven Rostedt, Suren Baghdasaryan, Tony Lu, Wen Gu, Wenjia Zhang,
Xu Panda, Zhang Zhengming
[-- Attachment #1: Type: text/plain, Size: 4396 bytes --]
On Thu, Dec 14, 2023 at 12:06:57PM -0700, Jens Axboe wrote:
> On 12/14/23 11:44 AM, Ahelenia Ziemiańska wrote:
> > This does that, effectively making splice(file -> pipe)
> > request (and require) O_NONBLOCK on reads fron the file:
> > this doesn't affect splicing from regular files and blockdevs,
> > since they're always non-blocking
> > (and requesting the stronger "no kernel sleep" IOCB_NOWAIT is non-sensical),
> Not sure how you got the idea that regular files or block devices is
> always non-blocking, this is certainly not true without IOCB_NOWAIT.
> Without IOCB_NOWAIT, you can certainly be waiting for previous IO to
> complete.
Maybe "always non-blocking" is an abuse of the term, but the terminology
is lost on me. By this I mean that O_NONBLOCK files/blockdevs have the
same semantics as non-O_NONBLOCK files/blockdevs ‒ they may block for a
bit while the I/O queue drains, but are guaranteed to complete within
a relatively narrow bounded time; any contending writer/opener
will be blocked for a short bit but will always wake up.
This is in contrast to pipes/sockets/ttys/&c., which wait for a peer to
send some data, and block until there is some; any contending writer/opener
will be blocked potentially ad infinitum.
Or, the way I see it, splice(socket -> pipe) can trivially be used to
lock the pipe forever, whereas I don't think splice(regfile -> pipe) can,
regardless of IOCB_NOWAIT, so the specific semantic IOCB_NOWAIT provides
is immaterial here, so not specifying IOCB_NOWAIT in filemap_splice_read()
provides semantics consistent to "file is read as-if it had O_NONBLOCK set".
> > but always returns -EINVAL for ttys.
> > Sockets behave as expected from O_NONBLOCK reads:
> > splice if there's data available else -EAGAIN.
> >
> > This should all pretty much behave as-expected.
> Should it? Seems like there's a very high risk of breaking existing use
> cases here.
If something wants to splice from a socket to a pipe and doesn't
degrade to read/write if it gets EAGAIN then it will either retry and
hotloop in the splice or error out, yeah.
I don't think this is surmountable.
> Have you at all looked into the approach of enabling splice to/from
> _without_ holding the pipe lock? That, to me, would seem like a much
> saner approach, with the caveat that I have not looked into that at all
> so there may indeed be reasons why this is not feasible.
IIUC Linus prepared a patch on security@ in
<CAHk-=whPmrWvXBqcK6ey_mnd-0fz_HNUHEfz3NX97mqoCCcwtA@mail.gmail.com>
(you're in To:) and an evolution of this is in
https://lore.kernel.org/lkml/CAHk-=wgmLd78uSLU9A9NspXyTM9s6C23OVDiN2YjA-d8_S0zRg@mail.gmail.com/t/#u
(you're in Cc:) that does this.
He summarises it below as
> So while fixing your NULL pointer check should be trivial, I think
> that first patch is actually fundamentally broken wrt pipe resizing,
> and I see no really sane way to fix it. We could add a new lock just
> for that, but I don't think it's worth it.
and
> But it is possible that we need to just bite the bullet and say
> "copy_splice_read() needs to use a non-blocking kiocb for the IO".
so that's what I did.
If Linus, who drew up and maintained this code for ~30 years,
didn't arrive at a satisfactory approach, I, after ~30 minutes,
won't either.
It would be very sane to both not change the semantic and fix the lock
by just not locking but at the top of that thread Christian said
> Splice would have to be
> refactored to not rely on pipe_lock(). That's likely major work with a
> good portion of regressions if the past is any indication.
and clearly this is true, so lacking the ability and capability
to do that and any reasonable other ideas
(You could either limit splices to a proportion of the pipe size,
but then just doing five splices gets you where we are rn
(or, as Linus construed it, into "write() returns -EBUSY" territory,
which is just as bad but at least the writers aren't unkillable),
and it reduces the I/O per splice significantly.
You could limit each pipe to one outstanding splice and always leave
Some space for normal I/O. This falls into "another lock just for this"
territory I think, and it also sucks for the 99% of normal users.)
I did this because Linus vaguely sanxioned it.
It's probably feasible, but alas it isn't feasible for me.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread