[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o8f9r7ug.fsf@nanos.tec.linutronix.de>
Date: Tue, 23 Mar 2021 20:24:55 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Oleg Nesterov <oleg@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Matt Fleming <matt@...eblueprint.co.uk>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [patch V4 2/2] signal: Allow tasks to cache one sigqueue struct
On Tue, Mar 23 2021 at 19:04, Oleg Nesterov wrote:
> On 03/22, Thomas Gleixner wrote:
>> +static void sigqueue_cache_or_free(struct sigqueue *q, bool cache)
>> + if (q) {
>> + tsk->sigqueue_cache = NULL;
>> + /* If task is self reaping, don't cache it back */
>> + sigqueue_cache_or_free(q, tsk != current);
> ^^^^^^^^^^^^^^
> Still not right or I am totally confused.
>
> tsk != current can be true if an exiting (and autoreaping) sub-thread
> releases its group leader.
>
> IOW. Suppose a process has 2 threads, its parent ignores SIGCHLD.
>
> The group leader L exits. Then its sub-thread T exits too and calls
> release_task(T). In this case the tsk != current is false.
>
> But after that T calls release_task(L) and L != T is true.
Bah. yes.
> I'd suggest to free tsk->sigqueue_cache in __exit_signal() unconditionally and
> remove the "bool cache" argument from sigqueue_cache_or_free().
That's what you get from trying to be clever, dammit.
Thanks for walking me through the oddities of exit !
tglx
Powered by blists - more mailing lists