public inbox for [email protected]
 help / color / mirror / Atom feed
From: [email protected] (Eric W. Biederman)
To: Jens Axboe <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected],
	Stefan Metzmacher <[email protected]>
Subject: Re: [PATCH 2/2] signal: don't allow STOP on PF_IO_WORKER threads
Date: Sat, 20 Mar 2021 11:21:50 -0500	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]> (Jens Axboe's message of "Sat, 20 Mar 2021 09:38:32 -0600")

Jens Axboe <[email protected]> writes:

> Just like we don't allow normal signals to IO threads, don't deliver a
> STOP to a task that has PF_IO_WORKER set. The IO threads don't take
> signals in general, and have no means of flushing out a stop either.

At first glance this seems safe.  This is before we count all of the
threads, and it needs to be a non io_uring thread.

Further we can change this decision later if necessary, as this is not
really exposed to userspace.

But please tell me why is it not the right thing to have the io_uring
helper threads stop?  Why is it ok for that process to go on consuming
cpu resources in a non-stoppable way.

Eric


> Reported-by: Stefan Metzmacher <[email protected]>
> Signed-off-by: Jens Axboe <[email protected]>
> ---
>  kernel/signal.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index 730ecd3d6faf..b113bf647fb4 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2349,6 +2349,10 @@ static bool do_signal_stop(int signr)
>  
>  		t = current;
>  		while_each_thread(current, t) {
> +			/* don't STOP PF_IO_WORKER threads */
> +			if (t->flags & PF_IO_WORKER)
> +				continue;
> +
>  			/*
>  			 * Setting state to TASK_STOPPED for a group
>  			 * stop is always done with the siglock held,

  reply	other threads:[~2021-03-20 16:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20 15:38 [PATCHSET 0/2] PF_IO_WORKER signal tweaks Jens Axboe
2021-03-20 15:38 ` [PATCH 1/2] signal: don't allow sending any signals to PF_IO_WORKER threads Jens Axboe
2021-03-20 16:18   ` Eric W. Biederman
2021-03-20 17:56     ` Linus Torvalds
2021-03-20 21:38       ` Eric W. Biederman
2021-03-20 22:42         ` Jens Axboe
2021-03-21 14:54           ` Eric W. Biederman
2021-03-21 15:40             ` Jens Axboe
2021-03-20 15:38 ` [PATCH 2/2] signal: don't allow STOP on " Jens Axboe
2021-03-20 16:21   ` Eric W. Biederman [this message]
2021-03-22 16:18     ` Oleg Nesterov
2021-03-22 16:15   ` Oleg Nesterov
2021-03-20 16:26 ` [PATCHSET 0/2] PF_IO_WORKER signal tweaks Eric W. Biederman
2021-03-20 17:51   ` Linus Torvalds
2021-03-20 19:18     ` Linus Torvalds
2021-03-20 22:08       ` Eric W. Biederman
2021-03-20 22:53         ` Jens Axboe
2021-03-21 15:18           ` Eric W. Biederman
2021-03-21 15:42             ` Jens Axboe
2021-03-20 22:56       ` Jens Axboe
2021-03-20 17:05 ` kernel test robot
2021-03-20 17:05 ` kernel test robot
2021-03-20 19:10 ` kernel test robot
2021-03-22 16:05 ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox