On 4/12/22 10:41 AM, Jens Axboe wrote: > On 4/12/22 10:24 AM, Pavel Begunkov wrote: >> If all completed requests in io_do_iopoll() were marked with >> REQ_F_CQE_SKIP, we'll not only skip CQE posting but also >> io_free_batch_list() leaking memory and resources. >> >> Move @nr_events increment before REQ_F_CQE_SKIP check. We'll potentially >> return the value greater than the real one, but iopolling will deal with >> it and the userspace will re-iopoll if needed. In anyway, I don't think >> there are many use cases for REQ_F_CQE_SKIP + IOPOLL. > > Ah good catch - yes probably not much practical concern, as the lack of > ordering for file IO means that CQE_SKIP isn't really useful for that > scenario. One potential snag is with the change we're now doing io_cqring_ev_posted_iopoll() even if didn't post an event. Again probably not a practical concern, but it is theoretically a violation if an eventfd is used. -- Jens Axboe