public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: add lockdep asserts to io_add_aux_cqe
@ 2025-05-09 11:03 Pavel Begunkov
  2025-05-09 14:02 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2025-05-09 11:03 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

io_add_aux_cqe() can only be called for rings with uring_lock protected
completion queues, add a couple of assertions in regards to that.

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

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 0fda1b1a33ae..13b8baaef834 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -844,6 +844,9 @@ bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags
  */
 void io_add_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags)
 {
+	lockdep_assert_held(&ctx->uring_lock);
+	lockdep_assert(ctx->lockless_cq);
+
 	if (!io_fill_cqe_aux(ctx, user_data, res, cflags)) {
 		spin_lock(&ctx->completion_lock);
 		io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
-- 
2.49.0


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

* Re: [PATCH 1/1] io_uring: add lockdep asserts to io_add_aux_cqe
  2025-05-09 11:03 [PATCH 1/1] io_uring: add lockdep asserts to io_add_aux_cqe Pavel Begunkov
@ 2025-05-09 14:02 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2025-05-09 14:02 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov


On Fri, 09 May 2025 12:03:43 +0100, Pavel Begunkov wrote:
> io_add_aux_cqe() can only be called for rings with uring_lock protected
> completion queues, add a couple of assertions in regards to that.
> 
> 

Applied, thanks!

[1/1] io_uring: add lockdep asserts to io_add_aux_cqe
      commit: 81a22c86ec7060be43404d4e6d68fca03dbafcf4

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2025-05-09 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09 11:03 [PATCH 1/1] io_uring: add lockdep asserts to io_add_aux_cqe Pavel Begunkov
2025-05-09 14:02 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox