Re: [PATCH] posix-timers: Target group sigqueue to current task only if not exiting
From: Dmitry Vyukov
Date: Mon Nov 25 2024 - 04:46:56 EST
On Sat, 23 Nov 2024 at 11:13, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> On 11/23, Frederic Weisbecker wrote:
> >
> > - * the same thread group as the target process, which avoids
> > - * unnecessarily waking up a potentially idle task.
> > + * the same thread group as the target process and its sighand is
> > + * stable, which avoids unnecessarily waking up a potentially idle task.
> > */
> > static inline struct task_struct *posixtimer_get_target(struct k_itimer *tmr)
> > {
> > struct task_struct *t = pid_task(tmr->it_pid, tmr->it_pid_type);
> >
> > - if (t && tmr->it_pid_type != PIDTYPE_PID && same_thread_group(t, current))
> > + if (t && tmr->it_pid_type != PIDTYPE_PID &&
> > + same_thread_group(t, current) && !current->exit_state)
> > t = current;
>
> Thanks!
>
> Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>
Can't the group leader be exiting as well? Though, that's still an
improvements. People usually don't do that (exiting from main w/o
killing the process). So thanks for the fix.