lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Mar 2022 05:43:25 -0700
From:   Jens Axboe <axboe@...nel.dk>
To:     Christoph Hellwig <hch@....de>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] task_work: simplify the task_work_add() interface

On 2/23/22 12:27 AM, Christoph Hellwig wrote:
> Provide a low-level task_work_add_nonotify interface that just adds
> the work to the list and open code the TWA_SIGNAL and TWA_NONE callers
> using it.  task_work_add() itself now only handles the common TWA_RESUME
> case and can drop the notify argument.

Not sure this is much of a cleanup, and a potential fast case of
TWA_NONE will now still still set TIF_NOTIFY_RESUME. Also:

> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 77b9c7e4793bf..94116a102dc61 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -9606,7 +9606,7 @@ static __cold void io_ring_exit_work(struct work_struct *work)
>  					ctx_node);
>  		/* don't spin on a single task if cancellation failed */
>  		list_rotate_left(&ctx->tctx_list);
> -		ret = task_work_add(node->task, &exit.task_work, TWA_SIGNAL);
> +		ret = task_work_add_nonotify(node->task, &exit.task_work);
>  		if (WARN_ON_ONCE(ret))
>  			continue;

This one is now no longer setting TIF_NOTIFY_SIGNAL.

If you want to get rid of the argument, why not just have separate
helpers? task_work_add_signal(), task_work_add_resume(),
task_work_add(). Setting TWA_RESUME unconditionally because it's the
common use case doesn't seem ideal.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ