lkml.org 
[lkml]   [2024]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] pidfd_poll: report POLLHUP when pid_task() == NULL
On 02/02, Christian Brauner wrote:
>
> > TODO: change do_notify_pidfd() to use the keyed wakeups.
>
> How does the following appended patch look?

No, no.

I think we need a simpler patch. I was going to send it as 4/4, but I'd
like to think more, _perhaps_ we can also discriminate the PIDFD_THREAD
and non-PIDFD_THREAD waiters. I'll try to make the patch(es) tomorrow or
at least provided more info.

3 notes for now:

1. we can't use wake_up_poll(), it passes nr_exclusive => 1

2. exit_notify() should not pass EPOLLHUP to wake_up, we do
not want to wake up the { .events = POLLHUP } waiters.

3. we do not need to change __change_pid().

Well, _perhaps_ it can/should use __wake_up_pollfree(), but
I need to check if fs/select.c use "autoremove" or not.


> -static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts)
> +static __poll_t pidfd_poll(struct file *file, poll_table *wait)
> {
> struct pid *pid = file->private_data;
> bool thread = file->f_flags & PIDFD_THREAD;
> struct task_struct *task;
> __poll_t poll_flags = 0;
>
> - poll_wait(file, &pid->wait_pidfd, pts);
> + poll_wait(file, &pid->wait_pidfd, wait);

This is correct but only cosemtic and has nothing to do with what
we discuss?

Oleg.


\
 
 \ /
  Last update: 2024-05-27 14:46    [W:5.888 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site