From: akpm@linux-foundation.org Subject: [patch 09/19] mm: oom: do not reap task if there are live threads in threadgroup Date: Fri, 27 May 2016 14:27:21 -0700 Message-ID: <5748bbb9.pxRcSfoGOyRhpd9G%akpm@linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from mail.linuxfoundation.org ([140.211.169.12]:45634 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbcE0V1W (ORCPT ); Fri, 27 May 2016 17:27:22 -0400 Sender: mm-commits-owner@vger.kernel.org List-Id: mm-commits@vger.kernel.org To: torvalds@linux-foundation.org, mm-commits@vger.kernel.org, akpm@linux-foundation.org, vdavydov@virtuozzo.com, mhocko@suse.com, penguin-kernel@I-love.SAKURA.ne.jp From: Vladimir Davydov Subject: mm: oom: do not reap task if there are live threads in threadgroup 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. Link: http://lkml.kernel.org/r/1464087628-7318-1-git-send-email-vdavydov@virtuozzo.com Fixes: 3ef22dfff239 ("oom, oom_reaper: try to reap tasks which skip regular OOM killer path")Signed-off-by: Vladimir Davydov Acked-by: Michal Hocko Cc: Tetsuo Handa Signed-off-by: Andrew Morton --- mm/oom_kill.c | 2 -- 1 file changed, 2 deletions(-) diff -puN mm/oom_kill.c~mm-oom-do-not-reap-task-if-there-are-live-threads-in-threadgroup mm/oom_kill.c --- a/mm/oom_kill.c~mm-oom-do-not-reap-task-if-there-are-live-threads-in-threadgroup +++ a/mm/oom_kill.c @@ -611,8 +611,6 @@ void try_oom_reaper(struct task_struct * if (!process_shares_mm(p, mm)) continue; - if (same_thread_group(p, tsk)) - continue; if (fatal_signal_pending(p)) continue; _