On 04/02/2021 14:52, Jens Axboe wrote: > On 2/4/21 6:52 AM, Pavel Begunkov wrote: >> Saving one lock/unlock for io-wq is not super important, but adds some >> ugliness in the code. More important, atomic decs not turning it to zero >> for some archs won't give the right ordering/barriers so the >> io_steal_work() may pretty easily get subtly and completely broken. >> >> Return back 2-step io-wq work exchange and clean it up. > > IIRC, this wasn't done to skip the lock/unlock exchange, which I agree > doesn't matter, but to ensure that a link would not need another io-wq > punt. And that is a big deal, it's much faster to run it from that > same thread, rather than needing a new async queue and new thread grab > to get there. Right, we just refer to different patches and moments. This one is fine in that regard, it just moves returning link from ->do_work() to ->free_work(). > > Just want to make sure that's on your mind... Maybe it's still fine > as-is, didn't look too closely yet or test it. > -- Pavel Begunkov