Re: [PATCH 1/6 v2] task_work: Provide means to check if a work is queued

From: Oleg Nesterov
Date: Mon Feb 10 2025 - 07:44:28 EST


On 02/09, Frederic Weisbecker wrote:
>
> @@ -56,6 +56,8 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
> {
> struct callback_head *head;
>
> + work->next = TASK_WORK_DEQUEUED;

Do we really need to do this at the start of task_work_add() ?

If the caller didn't do init_task_work() before and task_work_add()
returns -EINVAL we probably do not care?

Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>