Re: [PATCH 2/3] io_uring: fail io-wq submission from a task_work

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

 



On 2/20/21 6:01 PM, Pavel Begunkov wrote:
> On 18/02/2021 22:32, Pavel Begunkov wrote:
>> In case of failure io_wq_submit_work() needs to post an CQE and so
>> potentially take uring_lock. The safest way to deal with it is to do
>> that from under task_work where we can safely take the lock.
>>
>> Also, as io_iopoll_check() holds the lock tight and releases it
>> reluctantly, it will play nicer in the furuter with notifying an
>> iopolling task about new such pending failed requests.
>>
>> Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
>> ---
>> @@ -2371,11 +2371,22 @@ static void io_req_task_queue(struct io_kiocb *req)
>>  	req->task_work.func = io_req_task_submit;
>>  	ret = io_req_task_work_add(req);
>>  	if (unlikely(ret)) {
>> +		ret = -ECANCELED;
> 
> That's a stupid mistake. Jens, any chance you can fold in a diff below?

Yup done.

-- 
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