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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tycho,

I can't really read this patch now, possibly I am wrong, but...

On 11/30, Tycho Andersen wrote:
>
> @@ -263,16 +263,25 @@ void release_task(struct task_struct *p)
>  	 */
>  	zap_leader = 0;
>  	leader = p->group_leader;
> -	if (leader != p && thread_group_empty(leader)
> -			&& leader->exit_state == EXIT_ZOMBIE) {
> -		/*
> -		 * If we were the last child thread and the leader has
> -		 * exited already, and the leader's parent ignores SIGCHLD,
> -		 * then we are the one who should release the leader.
> -		 */
> -		zap_leader = do_notify_parent(leader, leader->exit_signal);
> -		if (zap_leader)
> -			leader->exit_state = EXIT_DEAD;
> +	if (leader != p) {
> +		if (thread_group_empty(leader)
> +				&& leader->exit_state == EXIT_ZOMBIE) {
> +			/*
> +			 * If we were the last child thread and the leader has
> +			 * exited already, and the leader's parent ignores SIGCHLD,
> +			 * then we are the one who should release the leader.
> +			 */
> +			zap_leader = do_notify_parent(leader,
> +						      leader->exit_signal);
> +			if (zap_leader)
> +				leader->exit_state = EXIT_DEAD;
> +		} else {
> +			/*
> +			 * wake up pidfd pollers anyway, they want to know this
> +			 * thread is dying.
> +			 */
> +			wake_up_all(&thread_pid->wait_pidfd);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

somehow I can't believe this is a good change after a quick glance ;)

I think that wake_up_all(wait_pidfd) should have a single caller,
do_notify_pidfd(). This probably means it should be shiftef from
do_notify_parent() to exit_notify(), I am not sure...

No?

Oleg.





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux