Thread (44 messages) flat view 44 messages, 4 authors, 2024-02-01

Re: [PATCH v3 1/3] pidfd: allow pidfd_open() on non-thread-group leaders

From: Oleg Nesterov <oleg@redhat.com>
Date: 2024-01-23 22:23:52
Also in: lkml

I am already sleeping. I'll try to reply to other parts of your email
tomorrow but I am not sure, I will be very busy with family duties.

On 01/23, Tycho Andersen wrote:
quoted
quoted
 	__exit_signal(p);
and,  do_notify_pidfd() is called before __exit_signal() which does
__unhash_process() -> detach_pid(PIDTYPE_PID).

Doesn't this mean that pidfd_poll() can hang? thread_group_exited()
won't return true after do_notify_pidfd() above, not to mention that
thread_group_empty() is not possible if !thread_group_leader().
I was wondering about this too, but the test_non_tgl_poll_exit test in
the next patch tests exactly this and works as expected.
Well, if release_task() completes __exit_signal() before the woken task
does thread_group_exited(), pid_task(PIDTYPE_PID) will return 0 and
pidfd_poll() won't hang.

But to be honest I can't understand test_non_tgl_poll_exit() at all. I don't
even understand why the process/thread created by fork_task_with_thread()
should ever exit. And why it creates the "writer" child... Never mind, too
late for me to read the code.

Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help