Re: [PATCH 1/2] kernel: split task_work_add() into two separate helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 08, 2020 at 12:34:38PM -0600, Jens Axboe wrote:
> Some callers may need to make signaling decisions based on the state
> of the targeted task, and that can only safely be done post adding
> the task_work to the task. Split task_work_add() into:
> 
> __task_work_add()	- adds the work item
> __task_work_notify()	- sends the notification
> 
> No functional changes in this patch.

Might be nice to mention __task_work_add() is now inline.

> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx # v5.7+
> Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
> ---
>  include/linux/task_work.h | 19 ++++++++++++++++
>  kernel/task_work.c        | 48 +++++++++++++++++++++------------------
>  2 files changed, 45 insertions(+), 22 deletions(-)



> +struct callback_head work_exited = {
> +	.next = NULL	/* all we need is ->next == NULL */
> +};

Would it make sense to make this const ? Esp. with the thing exposed,
sticking it in R/O memory might avoid a mistake somewhere.



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux