public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/2] io_uring: remove mutex in io_req_task_cancel()
Date: Thu, 19 Aug 2021 12:56:25 +0100	[thread overview]
Message-ID: <4479bb41699ed5d868c7f9a423c2dfb4d68541de.1629374041.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

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 <[email protected]>
---
 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


  reply	other threads:[~2021-08-19 11:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 11:56 [PATCH for-next 0/2] tw handlers cleanups Pavel Begunkov
2021-08-19 11:56 ` Pavel Begunkov [this message]
2021-08-19 11:56 ` [PATCH 2/2] io_uring: dedup tw-based request failing Pavel Begunkov
2021-08-19 15:49 ` [PATCH for-next 0/2] tw handlers cleanups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4479bb41699ed5d868c7f9a423c2dfb4d68541de.1629374041.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox