From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753675AbbJBNcu (ORCPT ); Fri, 2 Oct 2015 09:32:50 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:35927 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753342AbbJBNcr (ORCPT ); Fri, 2 Oct 2015 09:32:47 -0400 Date: Fri, 2 Oct 2015 15:32:44 +0200 From: Michal Hocko To: Tetsuo Handa Cc: oleg@redhat.com, akpm@linux-foundation.org, rientjes@google.com, kwalker@redhat.com, skozina@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm v2 1/3] mm/oom_kill: remove the wrong fatal_signal_pending() check in oom_kill_process() Message-ID: <20151002133244.GA16302@dhcp22.suse.cz> References: <20151001154115.GA10342@redhat.com> <20151001161916.GK24077@dhcp22.suse.cz> <20151001175319.GA16313@redhat.com> <201510022032.IFC65105.JFtMOQOVSHFLOF@I-love.SAKURA.ne.jp> <20151002121142.GD2927@dhcp22.suse.cz> <201510022133.IJB87676.OOOHFFMtVFSQJL@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201510022133.IJB87676.OOOHFFMtVFSQJL@I-love.SAKURA.ne.jp> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 02-10-15 21:33:08, Tetsuo Handa wrote: > Michal Hocko wrote: > > > Since T sends SIGKILL to all clone(CLONE_VM) tasks upon coredump, P needs > > > to do > > > > It does that only to all threads in the _same_ thread group AFAIU. > > I'm confused. What the _same_ thread group? > > I can observe that SIGKILL is sent to all > > clone(CLONE_THREAD | CLONE_SIGHAND | CLONE_VM) > clone(CLONE_SIGHAND | CLONE_VM) > clone(CLONE_VM) I might be missing something crucial here but copy_process has the following: if (clone_flags & CLONE_THREAD) { p->exit_signal = -1; p->group_leader = current->group_leader; p->tgid = current->tgid; } else { if (clone_flags & CLONE_PARENT) p->exit_signal = current->group_leader->exit_signal; else p->exit_signal = (clone_flags & CSIGNAL); p->group_leader = p; p->tgid = p->pid; } So clone without CLONE_THREAD should create a new thread group leader and so create a new thread group. Unless there is some other trickery which I do not see right now for_each_thread from the parent task shouldn't see those which are cloned without CLONE_THREAD. [...] > --- a/fs/coredump.c > +++ b/fs/coredump.c > @@ -295,6 +295,8 @@ static int zap_process(struct task_struct *start, int exit_code, int flags) > for_each_thread(start, t) { > task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK); > if (t != current && t->mm) { > + printk(KERN_INFO "Setting SIGKILL to %s(%u)\n", > + t->comm, t->pid); > sigaddset(&t->pending.signal, SIGKILL); > signal_wake_up(t, 1); > nr++; > ---------- debug printk() patch end ---------- OK, but all your tasks should trigger SEGV. You cannot find out whether all of them happened from the same zap_process, can you. -- Michal Hocko SUSE Labs