io_uring: mimimise io_cqring_wait_schedule
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 5 Jan 2023 11:22:25 +0000 (11:22 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 8 Jan 2023 18:18:44 +0000 (11:18 -0700)
commitcae0ad261cbe17c05a3072e9452104c2e3316e29
treef43397c0ac3ce6dcc283d9c2f19fda482e5c9851
parent22522155d2df661f937284af5d463482515bc690
io_uring: mimimise io_cqring_wait_schedule

io_cqring_wait_schedule() is called after we started waiting on the cq
wq and set the state to TASK_INTERRUPTIBLE, for that reason we have to
constantly worry whether we has returned the state back to running or
not. Leave only quick checks in io_cqring_wait_schedule() and move the
rest including running task work to the callers. Note, we run tw in the
loop after the sched checks because of the fast path in the beginning of
the function.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2814fabe75e2e019e7ca43ea07daa94564349805.1672916894.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c