Adding io_uring support to Netty, Josef noticed that there's another case where we can fail to process task_work in time. We previously added a "work-around" for eventfd, see: b7db41c9e03b ("io_uring: fix regression with always ignoring signals in io_cqring_wait()") but we can run into this dependency issue even without that. See the test case added to liburing: https://git.kernel.dk/cgit/liburing/tree/test/wakeup-hang.c for an example of that. This series adds a split way to call task_work_add(), so we can use TWA_SIGNAL if the task is currently not running. This over-reaches a bit since there are definitely cases where we do not need to use it, but better safe than sorry for now. -- Jens Axboe