提交 7de20989 编写于 作者: P Pavel Begunkov 提交者: Xiaoguang Wang

io_uring: don't do full *prep_worker() from io-wq

to #28170604

commit deb6dc0544884067b93bbf9a4716be323103b911 upstream

io_prep_async_worker() called io_wq_assign_next() do many useless checks:
io_req_work_grab_env() was already called during prep, and @do_hashed
is not ever used. Add io_prep_next_work() -- simplified version, that
can be called io-wq.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Acked-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 8cdcc9eb
...@@ -952,6 +952,17 @@ static inline void io_req_work_drop_env(struct io_kiocb *req) ...@@ -952,6 +952,17 @@ static inline void io_req_work_drop_env(struct io_kiocb *req)
} }
} }
static inline void io_prep_next_work(struct io_kiocb *req,
struct io_kiocb **link)
{
const struct io_op_def *def = &io_op_defs[req->opcode];
if (!(req->flags & REQ_F_ISREG) && def->unbound_nonreg_file)
req->work.flags |= IO_WQ_WORK_UNBOUND;
*link = io_prep_linked_timeout(req);
}
static inline bool io_prep_async_work(struct io_kiocb *req, static inline bool io_prep_async_work(struct io_kiocb *req,
struct io_kiocb **link) struct io_kiocb **link)
{ {
...@@ -2458,7 +2469,7 @@ static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt) ...@@ -2458,7 +2469,7 @@ static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt)
{ {
struct io_kiocb *link; struct io_kiocb *link;
io_prep_async_work(nxt, &link); io_prep_next_work(nxt, &link);
*workptr = &nxt->work; *workptr = &nxt->work;
if (link) { if (link) {
nxt->work.flags |= IO_WQ_WORK_CB; nxt->work.flags |= IO_WQ_WORK_CB;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册