[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z0BylnuVaxwCNP9n@pavilion.home>
Date: Fri, 22 Nov 2024 13:01:26 +0100
From: Frederic Weisbecker <frederic@...nel.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Anthony Mallet <anthony.mallet@...s.fr>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
linux-kernel@...r.kernel.org, Dmitry Vyukov <dvyukov@...gle.com>,
Marco Elver <elver@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: posix timer freeze after some random time, under pthread
create/destroy load
Le Fri, Nov 22, 2024 at 12:49:50PM +0100, Oleg Nesterov a écrit :
> On 11/22, Frederic Weisbecker wrote:
> >
> > Le Fri, Nov 22, 2024 at 09:24:07AM +0100, Oleg Nesterov a écrit :
> > > On 11/21, Frederic Weisbecker wrote:
> > > >
> > > > I think this started with commit:
> > > >
> > > > bcb7ee79029d (posix-timers: Prefer delivery of signals to the current thread)
> > > >
> > > > The problem is that if the current task is exiting and has already been reaped,
> > > > its sighand pointer isn't there anymore.
> > >
> > > Thanks...
> > >
> > > This can only happen if the exiting task has already passed exit_notify() which
> > > sets exit_state. So I'd suggest to check current->exit_state instead of PF_EXITING
> > > in the patch below.
> > >
> > > Oleg.
> >
> > Right, I don't mind either way,
>
> Me too, so feel free to ignore,
>
> > though if it's past PF_EXITING,
> > complete_signal() -> wants_signal() will defer to another thread anyway, right?
>
> Right. So I think it would be better to rely on complete_signal() in this
> case even if the current logic is very simple and dumb.
Just to make sure I understand correctly, this means you'd prefer to keep
the PF_EXITING test?
>
> > Due to retarget_shared_pending() being called after the flag being set...
>
> Yes. Whatever we do send_sigqueue/complete_signal can choose an exiting thread
> which doesn't have PF_EXITING yet, in this case retarget_shared_pending() from
> that thread will pick another target for signal_wake_up/TIF_SIGPENDING.
Right.
Thanks.
>
> Thanks!
>
> Oleg.
>
Powered by blists - more mailing lists