There's a case for io_uring where we want to run the task_work on ring exit, but we can't easily do that as we don't know if the task_works has work, or if exit work has already been queued. First two are just cleanups, third one makes task_work_exited externally visible, and fourth one let's io_uring call task_work_run() off the fops->release() path to fix an issue where we need to potentially flush work here. Since v1: - Don't add task_work_exited check to the fast path - Ensure exit_task_work() always runs -- Jens Axboe