On 8/5/21 4:05 AM, Hao Xu wrote: > We don't need to set task state to TASK_INTERRUPTIBLE at the beginning > of while() in io_wqe_worker(), which causes state resetting to > TASK_RUNNING in other place. Move it to above schedule_timeout() and > remove redundant task state settings. Not sure that is safe - the reason why the state is manipulated is to guard from races where we do: A B if (!work_available) Work inserted schedule(); As long as setting the task runnable is part of the work being inserted, then the above race is fine, as the schedule() turns into a no-op. -- Jens Axboe