All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: pick up link work on submit reference drop
@ 2020-02-25 20:27 Jens Axboe
  2020-02-25 21:22 ` Pavel Begunkov
  0 siblings, 1 reply; 12+ messages in thread
From: Jens Axboe @ 2020-02-25 20:27 UTC (permalink / raw)
  To: io-uring

If work completes inline, then we should pick up a dependent link item
in __io_queue_sqe() as well. If we don't do so, we're forced to go async
with that item, which is suboptimal.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ffd9bfa84d86..160cf1b0f478 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4531,8 +4531,15 @@ static void io_wq_submit_work(struct io_wq_work **workptr)
 		} while (1);
 	}
 
-	/* drop submission reference */
-	io_put_req(req);
+	/*
+	 * Drop submission reference. In case the handler already dropped the
+	 * completion reference, then it didn't pick up any potential link
+	 * work. If 'nxt' isn't set, try and do that here.
+	 */
+	if (nxt)
+		io_put_req(req);
+	else
+		io_put_req_find_next(req, &nxt);
 
 	if (ret) {
 		req_set_fail_links(req);

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-02-26 14:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 20:27 [PATCH] io_uring: pick up link work on submit reference drop Jens Axboe
2020-02-25 21:22 ` Pavel Begunkov
2020-02-25 21:25   ` Jens Axboe
2020-02-25 21:41     ` Jens Axboe
2020-02-25 22:18       ` Jens Axboe
2020-02-26  8:33         ` Pavel Begunkov
2020-02-26  9:46           ` Pavel Begunkov
2020-02-26 14:04           ` Jens Axboe
2020-02-25 21:45     ` Pavel Begunkov
2020-02-25 21:52       ` Pavel Begunkov
2020-02-25 22:24         ` Jens Axboe
2020-02-26  6:32           ` Pavel Begunkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.