public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: add lockdep checks for io_handle_tw_list
@ 2025-04-01 15:46 Pavel Begunkov
  2025-04-01 16:13 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Begunkov @ 2025-04-01 15:46 UTC (permalink / raw)
  To: io-uring; +Cc: asml.silence

Add a lockdep check to io_handle_tw_list() verifying that the context is
locked and no task work drops it by accident.

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

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 6df996d01ccf..13e0b48d1aac 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1054,6 +1054,10 @@ struct llist_node *io_handle_tw_list(struct llist_node *node,
 			mutex_lock(&ctx->uring_lock);
 			percpu_ref_get(&ctx->refs);
 		}
+
+		lockdep_assert(req->ctx == ctx);
+		lockdep_assert_held(&ctx->uring_lock);
+
 		INDIRECT_CALL_2(req->io_task_work.func,
 				io_poll_task_func, io_req_rw_complete,
 				req, ts);
-- 
2.48.1


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

end of thread, other threads:[~2025-04-01 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 15:46 [PATCH 1/1] io_uring: add lockdep checks for io_handle_tw_list Pavel Begunkov
2025-04-01 16:13 ` Jens Axboe
2025-04-01 17:19   ` Pavel Begunkov
2025-04-01 18:14     ` Jens Axboe

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