]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't resched with empty task_list
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 17 Jun 2021 17:14:09 +0000 (18:14 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Jun 2021 15:22:02 +0000 (09:22 -0600)
commite1f4207a035e68f782ebe63c5c2c4f32aed1fee5
tree5923c7a865afa0c81c7e2243e1974606d78ee099
parent829224b30aa1f9d525360281b4809b6e15a84b41
io_uring: don't resched with empty task_list

Entering tctx_task_work() with empty task_list is a strange scenario,
that can happen only on rare occasion during task exit, so let's not
check for task_list emptiness in advance and do it do-while style. The
code still correct for the empty case, just would do extra work about
which we don't care.

Do extra step and do the check before cond_resched(), so we don't
resched if have nothing to execute.

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