[PATCH] io_uring: Try to merge io requests only for regular files

Subsystems: filesystems (vfs and infrastructure), the rest

STALE1963d

4 messages, 4 authors, 2021-03-19 · open the first message on its own page

[PATCH] io_uring: Try to merge io requests only for regular files

From: Dmitry Monakhov <hidden>
Date: 2021-03-19 05:32:02

Otherwise we may endup blocking on pipe or socket.

Fixes: 6d5d5ac ("io_uring: extend async work merge")
Testcase: https://github.com/dmonakhov/liburing/commit/16d171b6ef9d68e6db66650a83d98c5c721d01f6
Signed-off-by: Dmitry Monakhov <redacted>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 478df7e..848657c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2183,6 +2183,9 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
 static struct async_list *io_async_list_from_req(struct io_ring_ctx *ctx,
 						 struct io_kiocb *req)
 {
+	if (!(req->flags & REQ_F_ISREG))
+		return NULL;
+
 	switch (req->submit.opcode) {
 	case IORING_OP_READV:
 	case IORING_OP_READ_FIXED:
-- 
2.7.4

Re: [PATCH] io_uring: Try to merge io requests only for regular files

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-03-19 06:37:44

On Fri, Mar 19, 2021 at 05:28:59AM +0000, Dmitry Monakhov wrote:
Otherwise we may endup blocking on pipe or socket.

Fixes: 6d5d5ac ("io_uring: extend async work merge")
Testcase: https://github.com/dmonakhov/liburing/commit/16d171b6ef9d68e6db66650a83d98c5c721d01f6
Signed-off-by: Dmitry Monakhov <redacted>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

Re: [PATCH] io_uring: Try to merge io requests only for regular files

From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2021-03-19 10:27:51

On 19/03/2021 05:28, Dmitry Monakhov wrote:
Otherwise we may endup blocking on pipe or socket.
CC: io-uring ml
quoted hunk
Fixes: 6d5d5ac ("io_uring: extend async work merge")
Testcase: https://github.com/dmonakhov/liburing/commit/16d171b6ef9d68e6db66650a83d98c5c721d01f6
Signed-off-by: Dmitry Monakhov <redacted>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 478df7e..848657c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2183,6 +2183,9 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
 static struct async_list *io_async_list_from_req(struct io_ring_ctx *ctx,
 						 struct io_kiocb *req)
 {
+	if (!(req->flags & REQ_F_ISREG))
+		return NULL;
+
 	switch (req->submit.opcode) {
 	case IORING_OP_READV:
 	case IORING_OP_READ_FIXED:
-- 
Pavel Begunkov

Re: [PATCH] io_uring: Try to merge io requests only for regular files

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-03-19 14:07:29

On Fri, Mar 19, 2021 at 05:28:59AM +0000, Dmitry Monakhov wrote:
Otherwise we may endup blocking on pipe or socket.

Fixes: 6d5d5ac ("io_uring: extend async work merge")
7 bytes of sha1 isn't enough.  You can set core.abbrev to 12 or upgrade
to a version of git from this decade to get that automatically.
2.7.4
... is from 2016, so you're five years out of date.  Don't get cut
off when git switches from SHA1.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help