Linux/linux 08f5439fs io_uring.c

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 at grimberg.me>
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Tested-by: Sagi Grimberg <sagi at grimberg.me>
Signed-off-by: Jens Axboe <axboe at kernel.dk>
DeltaFile
+7-1fs/io_uring.c
+7-11 files

UnifiedSplitRaw