And just for the record... Consider the simplest case: a single-threaded not-ptraced process exits. In this case do_notify_pidfd() will be called twice, from exit_notify() and right after that from do_notify_parent(). We can cleanup this logic, but I don't think this is important and this needs a separate patch. (With or without this change: if the exiting task is ptraced or its parent exits without wait(), do_notify_pidfd() will be called even more times, but I think we do not care at all). Oleg.