[PATCH 1/2] io_uring: remove mutex in io_req_task_cancel()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



io_req_complete_failed() only does io_req_complete_post(), which we
don't need to protect by ->uring_lock, so remove mutex_lock / unlock
from there.

Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
 fs/io_uring.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5e99473ad6fc..bdab831a1185 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2111,12 +2111,7 @@ static void io_req_task_work_add(struct io_kiocb *req)
 
 static void io_req_task_cancel(struct io_kiocb *req)
 {
-	struct io_ring_ctx *ctx = req->ctx;
-
-	/* ctx is guaranteed to stay alive while we hold uring_lock */
-	mutex_lock(&ctx->uring_lock);
 	io_req_complete_failed(req, req->result);
-	mutex_unlock(&ctx->uring_lock);
 }
 
 static void io_req_task_submit(struct io_kiocb *req)
-- 
2.32.0




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux