Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: don't pass ctx to tw add remote helper

Unlike earlier versions, io_msg_remote_post() creates a valid request
with a proper context, so don't pass a context to
io_req_task_work_add_remote() explicitly but derive it from the request.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/721f51cf34996d98b48f0bfd24ad40aa2730167e.1743190078.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
ea910678 9cc0bbda

+8 -11
+6 -8
io_uring/io_uring.c
··· 1141 1141 WARN_ON_ONCE(ret); 1142 1142 } 1143 1143 1144 - static inline void io_req_local_work_add(struct io_kiocb *req, 1145 - struct io_ring_ctx *ctx, 1146 - unsigned flags) 1144 + static void io_req_local_work_add(struct io_kiocb *req, unsigned flags) 1147 1145 { 1146 + struct io_ring_ctx *ctx = req->ctx; 1148 1147 unsigned nr_wait, nr_tw, nr_tw_prev; 1149 1148 struct llist_node *head; 1150 1149 ··· 1238 1239 void __io_req_task_work_add(struct io_kiocb *req, unsigned flags) 1239 1240 { 1240 1241 if (req->ctx->flags & IORING_SETUP_DEFER_TASKRUN) 1241 - io_req_local_work_add(req, req->ctx, flags); 1242 + io_req_local_work_add(req, flags); 1242 1243 else 1243 1244 io_req_normal_work_add(req); 1244 1245 } 1245 1246 1246 - void io_req_task_work_add_remote(struct io_kiocb *req, struct io_ring_ctx *ctx, 1247 - unsigned flags) 1247 + void io_req_task_work_add_remote(struct io_kiocb *req, unsigned flags) 1248 1248 { 1249 - if (WARN_ON_ONCE(!(ctx->flags & IORING_SETUP_DEFER_TASKRUN))) 1249 + if (WARN_ON_ONCE(!(req->ctx->flags & IORING_SETUP_DEFER_TASKRUN))) 1250 1250 return; 1251 - io_req_local_work_add(req, ctx, flags); 1251 + __io_req_task_work_add(req, flags); 1252 1252 } 1253 1253 1254 1254 static void __cold io_move_task_work_from_local(struct io_ring_ctx *ctx)
+1 -2
io_uring/io_uring.h
··· 89 89 unsigned issue_flags); 90 90 91 91 void __io_req_task_work_add(struct io_kiocb *req, unsigned flags); 92 - void io_req_task_work_add_remote(struct io_kiocb *req, struct io_ring_ctx *ctx, 93 - unsigned flags); 92 + void io_req_task_work_add_remote(struct io_kiocb *req, unsigned flags); 94 93 void io_req_task_queue(struct io_kiocb *req); 95 94 void io_req_task_complete(struct io_kiocb *req, io_tw_token_t tw); 96 95 void io_req_task_queue_fail(struct io_kiocb *req, int ret);
+1 -1
io_uring/msg_ring.c
··· 100 100 req->ctx = ctx; 101 101 req->tctx = NULL; 102 102 req->io_task_work.func = io_msg_tw_complete; 103 - io_req_task_work_add_remote(req, ctx, IOU_F_TWQ_LAZY_WAKE); 103 + io_req_task_work_add_remote(req, IOU_F_TWQ_LAZY_WAKE); 104 104 return 0; 105 105 } 106 106