From: Jens Axboe <[email protected]>
To: io-uring <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>,
Linus Torvalds <[email protected]>
Subject: [PATCH] io-wq: exclusively gate signal based exit on get_signal() return
Date: Mon, 27 Sep 2021 10:58:03 -0600 [thread overview]
Message-ID: <[email protected]> (raw)
io-wq threads block all signals, except SIGKILL and SIGSTOP. We should not
need any extra checking of signal_pending or fatal_signal_pending, rely
exclusively on whether or not get_signal() tells us to exit.
The original debugging of this issue led to the false positive that we
were exiting on non-fatal signals, but that is not the case. The issue
was around races with nr_workers accounting.
Fixes: 87c169665578 ("io-wq: ensure we exit if thread group is exiting")
Fixes: 15e20db2e0ce ("io-wq: only exit on fatal signals")
Reported-by: Eric W. Biederman <[email protected]>
Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
---
diff --git a/fs/io-wq.c b/fs/io-wq.c
index c2360cdc403d..5bf8aa81715e 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -584,10 +584,7 @@ static int io_wqe_worker(void *data)
if (!get_signal(&ksig))
continue;
- if (fatal_signal_pending(current) ||
- signal_group_exit(current->signal))
- break;
- continue;
+ break;
}
last_timeout = !ret;
}
--
Jens Axboe
next reply other threads:[~2021-09-27 16:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-27 16:58 Jens Axboe [this message]
2021-09-27 17:00 ` [PATCH] io-wq: exclusively gate signal based exit on get_signal() return Eric W. Biederman
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] \
/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