diff options
author | Oleg Nesterov <oleg@redhat.com> | 2025-03-23 20:19:55 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-03-25 16:59:05 +0300 |
commit | 0b7747a5477eb22d041997bc085fa8d492fa9b96 (patch) | |
tree | faeb062dc6fd4343c67c3e7a4938b20adf39de95 /tools/perf/scripts/python/libxed.py | |
parent | 2df0c02dab829dd89360d98a8a1abaa026ef5798 (diff) | |
download | linux-0b7747a5477eb22d041997bc085fa8d492fa9b96.tar.xz |
pidfs: cleanup the usage of do_notify_pidfd()
If a single-threaded process exits do_notify_pidfd() will be called twice,
from exit_notify() and right after that from do_notify_parent().
1. Change exit_notify() to call do_notify_pidfd() if the exiting task is
not ptraced and it is not a group leader.
2. Change do_notify_parent() to call do_notify_pidfd() unconditionally.
If tsk is not ptraced, do_notify_parent() will only be called when it
is a group-leader and thread_group_empty() is true.
This means that if tsk is ptraced, do_notify_pidfd() will be called from
do_notify_parent() even if tsk is a delay_group_leader(). But this case is
less common, and apart from the unnecessary __wake_up() is harmless.
Granted, this unnecessary __wake_up() can be avoided, but I don't want to
do it in this patch because it's just a consequence of another historical
oddity: we notify the tracer even if !thread_group_empty(), but do_wait()
from debugger can't work until all other threads exit. With or without this
patch we should either eliminate do_notify_parent() in this case, or change
do_wait(WEXITED) to untrace the ptraced delay_group_leader() at least when
ptrace_reparented().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250323171955.GA834@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions