From: ebiederm@xmission.com (Eric W. Biederman)
To: <wen.yang99@zte.com.cn>
Cc: <torvalds@linux-foundation.org>, <oleg@redhat.com>,
<akpm@linux-foundation.org>, <linux-kernel@vger.kernel.org>,
<ma.jiang@zte.com.cn>, <chen.shengyuan@zte.com.cn>,
<zhong.weidong@zte.com.cn>
Subject: Re: [PATCH v6 6/6] signal: Don't restart fork when signals come in.
Date: Fri, 10 Aug 2018 07:15:28 -0500 [thread overview]
Message-ID: <8736vmto2n.fsf@xmission.com> (raw)
In-Reply-To: <201808101434273569497@zte.com.cn> (wen's message of "Fri, 10 Aug 2018 14:34:27 +0800 (CST)")
<wen.yang99@zte.com.cn> writes:
> ebiederm@xmission.com <ebiederm@xmission.com> writes
>> Subject: [PATCH v6 6/6] signal: Don't restart fork when signals come in.
>>
>> Wen Yang <wen.yang99@zte.com.cn> and majiang <ma.jiang@zte.com.cn>
>> report that a periodic signal received during fork can cause fork to
>> continually restart preventing an application from making progress.
>>
>> ...
>> diff --git a/kernel/signal.c b/kernel/signal.c
>> index 9f0eafb6d474..cfa9d10e731a 100644
>> --- a/kernel/signal.c
>> +++ b/kernel/signal.c
>> @@ -1121,6 +1121,21 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
>> out_set:
>> signalfd_notify(t, sig);
>> sigaddset(&pending->signal, sig);
>> +
>> + /* Let multiprocess signals appear after on-going forks */
>> + if (type > PIDTYPE_TGID) {
>> + struct multiprocess_signals *delayed;
>> + hlist_for_each_entry(delayed, &t->signal->multiprocess, node) {
>> + sigset_t *signal = &delayed->signal;
>> + /* Can't queue both a stop and a continue signal */
>> + if (sig == SIGCONT)
>> + sigdelsetmask(signal, SIG_KERNEL_STOP_MASK);
>> + else if (sig_kernel_stop(sig))
>> + sigdelset(signal, SIGCONT);
>> + sigaddset(signal, sig);
>> + }
>> + }
>> +
>> complete_signal(sig, t, type);
>> ret:
>> trace_signal_generate(sig, info, t, type != PIDTYPE_PID, result);
>
> I've migrated this patch and try to test it, but I ran into a compile error:
>
> kernel/signal.c: In function '__send_signal':
> kernel/signal.c:1192:9: error: 'type' undeclared (first use in this function)
> if (type > PIDTYPE_TGID) {
> ^
> We may also need some patches, which pass pid type into
> __send_signal.
We most definitely need the the first 15 patches from my last series of
patches that push the pid type down.
I did not repeat them here because there is consensus that they
are fine working fine.
I have a branch with everything at:
https://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git siginfo-testing
Eric
next parent reply other threads:[~2018-08-10 12:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201808101434273569497@zte.com.cn>
2018-08-10 12:15 ` Eric W. Biederman [this message]
2018-08-09 6:53 [PATCH v5 0/6] Not restarting for due to signals Eric W. Biederman
2018-08-09 6:56 ` [PATCH v5 6/6] signal: Don't restart fork when signals come in Eric W. Biederman
2018-08-09 17:15 ` Linus Torvalds
2018-08-09 18:09 ` [PATCH v6 " Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736vmto2n.fsf@xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=chen.shengyuan@zte.com.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=ma.jiang@zte.com.cn \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.org \
--cc=wen.yang99@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox