On 4/2/20 12:54 PM, Bijan Mottahedeh wrote: > A request that completes with an -EAGAIN result after it has been added > to the poll list, will not be removed from that list in io_do_iopoll() > because the f_op->iopoll() will not succeed for that request. > > Maintain a retryable local list similar to the done list, and explicity > reissue requests with an -EAGAIN result. I think this looks reasonable. You could make the loop here: > +static void io_iopoll_queue(struct list_head *again) > +{ > + struct io_kiocb *req; > + > + while (!list_empty(again)) { > + req = list_first_entry(again, struct io_kiocb, list); > + list_del(&req->list); > + refcount_inc(&req->refs); > + io_queue_async_work(req); > + } > +} be: do { req = list_first_entry(again, struct io_kiocb, list); list_del(&req->list); refcount_inc(&req->refs); io_queue_async_work(req); } while (!list_empty(again)); as you always enter with it non-empty, at least that eliminates one check per list. We could also issue inline again, instead of punting these async. But probably not worth the bother. -- Jens Axboe