lkml.org 
[lkml]   [2018]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 6/6] signal: Don't restart fork when signals come in.
<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

\
 
 \ /
  Last update: 2018-08-10 14:16    [W:0.029 / U:31.476 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site