From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754925AbcEXLqQ (ORCPT ); Tue, 24 May 2016 07:46:16 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34673 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbcEXLqP (ORCPT ); Tue, 24 May 2016 07:46:15 -0400 Date: Tue, 24 May 2016 13:46:12 +0200 From: Michal Hocko To: Vladimir Davydov Cc: Andrew Morton , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: oom: do not reap task if there are live threads in threadgroup Message-ID: <20160524114612.GG8259@dhcp22.suse.cz> References: <1464087628-7318-1-git-send-email-vdavydov@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464087628-7318-1-git-send-email-vdavydov@virtuozzo.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 24-05-16 14:00:28, Vladimir Davydov wrote: > If the current process is exiting, we don't invoke oom killer, instead > we give it access to memory reserves and try to reap its mm in case > nobody is going to use it. There's a mistake in the code performing this > check - we just ignore any process of the same thread group no matter if > it is exiting or not - see try_oom_reaper. Fix it. This is not a problem with the current code because of 98748bd72200 ("oom: consider multi-threaded tasks in task_will_free_mem") which got merged later on, however. The check is not needed so we can indeed drop it. Fixes: 3ef22dfff239 ("oom, oom_reaper: try to reap tasks which skip regular OOM killer path") Just in case somebody wants to backport only 3ef22dfff239. > Signed-off-by: Vladimir Davydov Acked-by: Michal Hocko Thanks! > --- > mm/oom_kill.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/mm/oom_kill.c b/mm/oom_kill.c > index c0e37dd1422f..03bf7a472296 100644 > --- a/mm/oom_kill.c > +++ b/mm/oom_kill.c > @@ -618,8 +618,6 @@ void try_oom_reaper(struct task_struct *tsk) > > if (!process_shares_mm(p, mm)) > continue; > - if (same_thread_group(p, tsk)) > - continue; > if (fatal_signal_pending(p)) > continue; > > -- > 2.1.4 -- Michal Hocko SUSE Labs