On 04/08, Jens Axboe wrote: > > Here's some more data. I added a WARN_ON_ONCE() for task->flags & > PF_EXITING on task_work_add() success, and it triggers with the > following backtrace: ... > which means that we've successfully added the task_work while the > process is exiting. but this is fine, task_work_add(task) can succeed if task->flags & EXITING. task_work_add(task, work) should only fail if this "task" has already passed exit_task_work(). Because if this task has already passed exit_task_work(), nothing else can flush this work and call work->func(). Oleg.