public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH for-next 6/9] io_uring: don't raw spin unlock to match cq_lock
Date: Wed, 30 Nov 2022 15:21:56 +0000	[thread overview]
Message-ID: <4ca4f0564492b90214a190cd5b2a6c76522de138.1669821213.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

There is one newly added place when we lock ring with io_cq_lock() but
unlocking is hand coded calling spin_unlock directly. It's ugly and
troublesome in the long run.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 io_uring/io_uring.c | 2 +-
 io_uring/io_uring.h | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 15d285d8ce0f..c30765579a8e 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -860,7 +860,7 @@ bool io_aux_cqe(struct io_ring_ctx *ctx, bool defer, u64 user_data, s32 res, u32
 		io_cq_lock(ctx);
 		__io_flush_post_cqes(ctx);
 		/* no need to flush - flush is deferred */
-		spin_unlock(&ctx->completion_lock);
+		io_cq_unlock(ctx);
 	}
 
 	/* For defered completions this is not as strict as it is otherwise,
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 062899b1fe86..2277c05f52a6 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -93,6 +93,11 @@ static inline void io_cq_lock(struct io_ring_ctx *ctx)
 	spin_lock(&ctx->completion_lock);
 }
 
+static inline void io_cq_unlock(struct io_ring_ctx *ctx)
+{
+	spin_unlock(&ctx->completion_lock);
+}
+
 void io_cq_unlock_post(struct io_ring_ctx *ctx);
 
 static inline struct io_uring_cqe *io_get_cqe_overflow(struct io_ring_ctx *ctx,
-- 
2.38.1


  parent reply	other threads:[~2022-11-30 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 15:21 [PATCH for-next 0/9] poll & rsrc quiesce improvements Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 1/9] io_uring: kill io_poll_issue's PF_EXITING check Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 2/9] io_uring: carve io_poll_check_events fast path Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 3/9] io_uring: remove ctx variable in io_poll_check_events Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 4/9] io_uring: imporve poll warning handling Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 5/9] io_uring: combine poll tw handlers Pavel Begunkov
2022-11-30 15:21 ` Pavel Begunkov [this message]
2022-11-30 15:21 ` [PATCH for-next 7/9] io_uring: improve rsrc quiesce refs checks Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 8/9] io_uring: don't reinstall quiesce node for each tw Pavel Begunkov
2022-11-30 15:21 ` [PATCH for-next 9/9] io_uring: reshuffle issue_flags Pavel Begunkov
2022-11-30 18:07 ` [PATCH for-next 0/9] poll & rsrc quiesce improvements 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=4ca4f0564492b90214a190cd5b2a6c76522de138.1669821213.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