Skip to content

Commit 9ed5210

Browse files
oleg-nesterovbrauner
authored andcommitted
pidfd: change do_notify_pidfd() to use __wake_up(poll_to_key(EPOLLIN))
rather than wake_up_all(). This way do_notify_pidfd() won't wakeup the POLLHUP-only waiters which wait for pid_task() == NULL. TODO: - as Christian pointed out, this asks for the new wake_up_all_poll() helper, it can already have other users. - we can probably discriminate the PIDFD_THREAD and non-PIDFD_THREAD waiters, but this needs more work. See https://lore.kernel.org/all/20240205140848.GA15853@redhat.com/ Signed-off-by: Oleg Nesterov <oleg@redhat.com> Link: https://lore.kernel.org/r/20240205141348.GA16539@redhat.com Reviewed-by: Tycho Andersen <tandersen@netflix.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent a1c6d54 commit 9ed5210

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

kernel/signal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,11 +2021,12 @@ int send_sigqueue(struct sigqueue *q, struct pid *pid, enum pid_type type)
20212021

20222022
void do_notify_pidfd(struct task_struct *task)
20232023
{
2024-
struct pid *pid;
2024+
struct pid *pid = task_pid(task);
20252025

20262026
WARN_ON(task->exit_state == 0);
2027-
pid = task_pid(task);
2028-
wake_up_all(&pid->wait_pidfd);
2027+
2028+
__wake_up(&pid->wait_pidfd, TASK_NORMAL, 0,
2029+
poll_to_key(EPOLLIN | EPOLLRDNORM));
20292030
}
20302031

20312032
/*

0 commit comments

Comments
 (0)