Re: [PATCH 1/3] io-wq: clean code of task state setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux