io-wq: exclusively gate signal based exit on get_signal() return
Jens Axboe
maintainerPATCH 1/1 io-wq: exclusively gate signal based exit on get_signal() return
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.
---
fs/io-wq.c +1 -4
@@ -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; }
Signature · 1 line
Jens Axboe
Quoted 7 lines · Jens Axboe
io-wq threads block all signals, except SIGKILL and SIGSTOP. We should not need any extra checking of
signal_pendingorfatal_signal_pending, rely exclusively on whether or notget_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_workersaccounting.
Quoted 25 lines
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]>---
fs/io-wq.c +1
-4@@ -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; }