Thread (14 messages) 14 messages, 2 authors, 2024-02-05

Re: [PATCH 1/3] pidfd_poll: report POLLHUP when pid_task() == NULL

From: Christian Brauner <brauner@kernel.org>
Date: 2024-02-02 15:16:33
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

On Fri, Feb 02, 2024 at 03:44:45PM +0100, Christian Brauner wrote:
quoted
TODO: change do_notify_pidfd() to use the keyed wakeups.
How does the following appended patch look?
I missed the conversion in detach_pid() which should also just become:
diff --git a/kernel/pid.c b/kernel/pid.c
index de0bf2f8d18b..1bfcfa195226 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -351,7 +351,8 @@ static void __change_pid(struct task_struct *task, enum pid_type type,

        if (type == PIDTYPE_PID) {
                WARN_ON_ONCE(pid_has_task(pid, PIDTYPE_PID));
-               wake_up_all(&pid->wait_pidfd);
+               pidfd_wake_up_poll(&pid->wait_pidfd,
+                                  EPOLLIN | EPOLLRDNORM | EPOLLHUP);
        }

        for (tmp = PIDTYPE_MAX; --tmp >= 0; )
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help