Re: [PATCH] task_work: cleanup notification modes

From: Thomas Gleixner
Date: Sat Oct 17 2020 - 11:32:01 EST


On Fri, Oct 16 2020 at 17:43, Jens Axboe wrote:
> On 10/16/20 5:38 PM, Thomas Gleixner wrote:
> If you know the task isn't exiting, then yeah you can ignore it. But
> seems a bit dicey...

Indeed.

>> fs/io_uring.c- if (unlikely(ret)) {
>> fs/io_uring.c- struct task_struct *tsk;
>> fs/io_uring.c-
>> fs/io_uring.c- init_task_work(&req->task_work, io_req_task_cancel);
>> fs/io_uring.c- tsk = io_wq_get_task(req->ctx->io_wq);
>> fs/io_uring.c: task_work_add(tsk, &req->task_work, 0);
>> fs/io_uring.c- wake_up_process(tsk);
>>
>> yet more magic wakeup.
>
> It's not magic, but probably needs a comment... If we fail, that task is
> exiting. But we know we have our io-wq threads, so we use that as a
> fallback. Not really expected in the fast path.

I somehow misread it. So ignore me.

Thanks,

tglx