diff mbox series

[4/4] io_uring: use local ctx cancelation state for io_req_local_work_add()

Message ID 20230217155600.157041-5-axboe@kernel.dk (mailing list archive)
State New
Headers show
Series Cache tctx cancelation state in the ctx | expand

Commit Message

Jens Axboe Feb. 17, 2023, 3:56 p.m. UTC
Rather than look into the remote task state and multiple layers of
memory dereferencing, just use the local state instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 0fcb532db1fc..792ab44393c2 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1291,7 +1291,7 @@  static void io_req_local_work_add(struct io_kiocb *req)
 	/* needed for the following wake up */
 	smp_mb__after_atomic();
 
-	if (unlikely(atomic_read(&req->task->io_uring->in_cancel))) {
+	if (unlikely(test_bit(0, &ctx->in_cancel))) {
 		io_move_task_work_from_local(ctx);
 		goto put_ref;
 	}