On 21/06/2020 18:23, Jens Axboe wrote: > On 6/21/20 4:30 AM, Pavel Begunkov wrote: >> Because of need_resched() check, io_uring_enter() -> io_iopoll_check() >> can return 0 even if @min_complete wasn't satisfied. If that's the >> case, __io_uring_get_cqe() sets submit=0 and wait_nr=0, disabling >> setting IORING_ENTER_GETEVENTS as well. So, it goes crazy calling >> io_uring_enter() in a loop, not actually submitting nor polling. >> >> Set @wait_nr based on actual number of CQEs ready. >> BTW, atomic_load_acquire() in io_uring_cq_ready() can be replaced >> with a relaxed one for this particular place. > > Can you preface this with an addition of __io_uring_cqe_ready() that > doesn't include the load acquire? Sure > Also, s/io_adjut_wait_nr/io_adjust_wait_nr for the patch. Ouch, a typo -- Pavel Begunkov