]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: add need_resched() check in inner poll loop
authorJens Axboe <axboe@kernel.dk>
Thu, 22 Aug 2019 04:19:11 +0000 (22:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Aug 2019 21:32:28 +0000 (15:32 -0600)
commitf109dc8f86b8fe1750d76c5f34de46b342a266fb
tree13c09fd0f29e89e733080f92239c76f97e6a018d
parent85d03c175c8aa5e42870a1e3c090350defd4a830
io_uring: add need_resched() check in inner poll loop

The outer poll loop checks for whether we need to reschedule, and
returns to userspace if we do. However, it's possible to get stuck
in the inner loop as well, if the CPU we are running on needs to
reschedule to finish the IO work.

Add the need_resched() check in the inner loop as well. This fixes
a potential hang if the kernel is configured with
CONFIG_PREEMPT_VOLUNTARY=y.

Reported-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c