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

Jens Axboe
2022-03-09T21:05:57Z

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