On 9/11/21 1:40 PM, Hao Xu wrote: > Given max_worker is 1, and we currently have 1 running and it is > exiting. There may be race like: > io_wqe_enqueue worker1 > no work there and timeout > unlock(wqe->lock) > ->insert work > -->io_worker_exit > lock(wqe->lock) > ->if(!nr_workers) //it's still 1 > unlock(wqe->lock) > goto run_cancel > lock(wqe->lock) > nr_workers-- > ->dec_running > ->worker creation fails > unlock(wqe->lock) > > We enqueued one work but there is no workers, causes hung. This one also looks good, applied. -- Jens Axboe