On 1/3/21 9:29 AM, Pavel Begunkov wrote: > On 03/01/2021 15:12, Jens Axboe wrote: >> On 1/2/21 9:06 AM, Pavel Begunkov wrote: >>> IOPOLL skips completion locking but keeps it under uring_lock, thus >>> io_cqring_overflow_flush() and so io_cqring_events() need extra care. >>> Add extra conditional locking around them. >> >> This one is pretty ugly. Would be greatly preferable to grab the lock >> higher up instead of passing down the need to do so, imho. > I can't disagree with that, the whole iopoll locking is a mess, but > still don't want to penalise SQPOLL|IOPOLL. > > Splitting flushing from cqring_events might be a good idea. How > about the one below (not tested)? Killing this noflush looks even > cleaner than before. >From a quick look, that's much better. -- Jens Axboe