From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756088AbbJAQTV (ORCPT ); Thu, 1 Oct 2015 12:19:21 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:36398 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbbJAQTS (ORCPT ); Thu, 1 Oct 2015 12:19:18 -0400 Date: Thu, 1 Oct 2015 18:19:16 +0200 From: Michal Hocko To: Oleg Nesterov Cc: Andrew Morton , David Rientjes , Kyle Walker , Stanislav Kozina , Tetsuo Handa , 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: <20151001161916.GK24077@dhcp22.suse.cz> References: <20150930182341.GA15047@redhat.com> <20150930182405.GA15238@redhat.com> <20151001124941.GC24077@dhcp22.suse.cz> <20151001150010.GB6781@redhat.com> <20151001152739.GJ24077@dhcp22.suse.cz> <20151001154115.GA10342@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151001154115.GA10342@redhat.com> 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 Thu 01-10-15 17:41:15, Oleg Nesterov wrote: > On 10/01, Michal Hocko wrote: > > > > On Thu 01-10-15 17:00:10, Oleg Nesterov wrote: > > > On 10/01, Michal Hocko wrote: > > > > > > > > On Wed 30-09-15 20:24:05, Oleg Nesterov wrote: > > > > [...] > > > > > It is possible that the group leader > > > > > has the pending SIGKILL because its sub-thread originated the coredump, > > > > > in this case we must not skip this process. > > > > > > > > I do not understand this. If the group leader has SIGKILL pending it > > > > will die anyway regardless whether we send another sigkill or not, no? > > > > > > Yes it will die, but only after the coredump is finished. > > > > > > Suppose we have a thread group with the group leader P and another > > > thread T. If T starts the coredump, it sends SIGKILL to P and waits > > > until it parks in exit_mm(). Then T actually dumps the core which may > > > need more memory, a lot of time, etc. > > > > > > We need to kill this process. Yes, P is already killed and it sleeps > > > in TASK_UNINTERRUPTIBLE so this thread does not need SIGKILL. But > > > do_send_sig_info(P) will also find T and kill it too to make > > > dump_interrupted() == T. > > > > I am still utterly confused :( Where do we kill T if it is not in the > > same thread group with P? > > But it is in the same thread group? The whole loop is about sending sigkill to a process from a different thread group though. And this is what confused me completely. But I got the point finally. zap_process will add SIGKILL to all threads but the current which will go on without being killed and if this is not a thread group leader then we would miss it. Thanks for the clarification and feel free to add Acked-by: Michal Hocko -- Michal Hocko SUSE Labs