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

From: Frederic Weisbecker
Date: Tue Mar 25 2025 - 10:27:40 EST


Le Mon, Feb 10, 2025 at 01:43:41PM +0100, Oleg Nesterov a écrit :
> 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?

Yes good point. Let me fix that...

>
> Reviewed-by: Oleg Nesterov <oleg@xxxxxxxxxx>
>