]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
io_uring: don't miss setting IO_WQ_WORK_CONCURRENT
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 22 Oct 2020 15:47:16 +0000 (16:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:39:03 +0000 (12:39 +0100)
[ Upstream commit feaadc4fc2ebdbd53ffed1735077725855a2af53 ]

Set IO_WQ_WORK_CONCURRENT for all REQ_F_FORCE_ASYNC requests, do that in
that is also looks better.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c

index 64f214a3dc9dd1f677bc36febc136e43a7529104..eba5f65493a10b00d2a0d7760b903f178aa736fc 100644 (file)
@@ -1140,6 +1140,9 @@ static void io_prep_async_work(struct io_kiocb *req)
 
        io_req_init_async(req);
 
+       if (req->flags & REQ_F_FORCE_ASYNC)
+               req->work.flags |= IO_WQ_WORK_CONCURRENT;
+
        if (req->flags & REQ_F_ISREG) {
                if (def->hash_reg_file || (req->ctx->flags & IORING_SETUP_IOPOLL))
                        io_wq_hash_work(&req->work, file_inode(req->file));
@@ -6281,13 +6284,6 @@ fail_req:
                        if (unlikely(ret))
                                goto fail_req;
                }
-
-               /*
-                * Never try inline submit of IOSQE_ASYNC is set, go straight
-                * to async execution.
-                */
-               io_req_init_async(req);
-               req->work.flags |= IO_WQ_WORK_CONCURRENT;
                io_queue_async_work(req);
        } else {
                __io_queue_sqe(req, sqe, cs);