All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] io_uring: remove REQ_F_IO_DRAINED
@ 2020-01-17 22:22 Pavel Begunkov
  2020-01-17 22:22 ` [PATCH 2/2] io_uring: optimise sqe-to-req flags translation Pavel Begunkov
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Pavel Begunkov @ 2020-01-17 22:22 UTC (permalink / raw)
  To: Jens Axboe, io-uring, linux-kernel

A request can get into the defer list only once, there is no need for
marking it as drained, so remove it. This probably was left after
extracting __need_defer() for use in timeouts.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 fs/io_uring.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 9ee01c7422cb..163707ac9e76 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -499,7 +499,6 @@ struct io_kiocb {
 #define REQ_F_FIXED_FILE	4	/* ctx owns file */
 #define REQ_F_LINK_NEXT		8	/* already grabbed next link */
 #define REQ_F_IO_DRAIN		16	/* drain existing IO first */
-#define REQ_F_IO_DRAINED	32	/* drain done */
 #define REQ_F_LINK		64	/* linked sqes */
 #define REQ_F_LINK_TIMEOUT	128	/* has linked timeout */
 #define REQ_F_FAIL_LINK		256	/* fail rest of links */
@@ -815,7 +814,7 @@ static inline bool __req_need_defer(struct io_kiocb *req)
 
 static inline bool req_need_defer(struct io_kiocb *req)
 {
-	if ((req->flags & (REQ_F_IO_DRAIN|REQ_F_IO_DRAINED)) == REQ_F_IO_DRAIN)
+	if (unlikely(req->flags & REQ_F_IO_DRAIN))
 		return __req_need_defer(req);
 
 	return false;
@@ -937,10 +936,8 @@ static void io_commit_cqring(struct io_ring_ctx *ctx)
 
 	__io_commit_cqring(ctx);
 
-	while ((req = io_get_deferred_req(ctx)) != NULL) {
-		req->flags |= REQ_F_IO_DRAINED;
+	while ((req = io_get_deferred_req(ctx)) != NULL)
 		io_queue_async_work(req);
-	}
 }
 
 static struct io_uring_cqe *io_get_cqring(struct io_ring_ctx *ctx)
-- 
2.24.0


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

end of thread, other threads:[~2020-01-19 17:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 22:22 [PATCH 1/2] io_uring: remove REQ_F_IO_DRAINED Pavel Begunkov
2020-01-17 22:22 ` [PATCH 2/2] io_uring: optimise sqe-to-req flags translation Pavel Begunkov
2020-01-17 22:41 ` [PATCH 0/2] optimise sqe-to-req flags Pavel Begunkov
2020-01-17 22:49   ` Jens Axboe
2020-01-17 23:14     ` Pavel Begunkov
2020-01-18  0:16       ` Jens Axboe
2020-01-18 10:24         ` [PATCH v2] io_uring: optimise sqe-to-req flags translation Pavel Begunkov
2020-01-18 16:34           ` Jens Axboe
2020-01-18 17:10             ` Pavel Begunkov
2020-01-18 17:22               ` [PATCH v3 1/1] " Pavel Begunkov
2020-01-18 20:46                 ` Jens Axboe
2020-01-19  7:46                   ` Pavel Begunkov
2020-01-19 17:36                     ` Jens Axboe
2020-01-18 20:45               ` [PATCH v2] " Jens Axboe
2020-01-17 22:50 ` [PATCH 1/2] io_uring: remove REQ_F_IO_DRAINED Jens Axboe

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.