Re: [PATCH 07/13] task_work: Introduce task_work_pending

From: Jens Axboe
Date: Wed Mar 09 2022 - 16:05:57 EST


On 3/9/22 9:24 AM, Eric W. Biederman wrote:
> diff --git a/include/linux/task_work.h b/include/linux/task_work.h
> index 5b8a93f288bb..897494b597ba 100644
> --- a/include/linux/task_work.h
> +++ b/include/linux/task_work.h
> @@ -19,6 +19,11 @@ enum task_work_notify_mode {
> TWA_SIGNAL,
> };
>
> +static inline bool task_work_pending(struct task_struct *task)
> +{
> + return READ_ONCE(task->task_works);
> +}
> +

Most of the checks for this is current, do we need READ_ONCE here?

--
Jens Axboe