From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by kanga.kvack.org (Postfix) with ESMTP id A5DF76B0005 for ; Tue, 31 May 2016 11:04:10 -0400 (EDT) Received: by mail-oi0-f70.google.com with SMTP id r64so308054753oie.1 for ; Tue, 31 May 2016 08:04:10 -0700 (PDT) Received: from www262.sakura.ne.jp (www262.sakura.ne.jp. [202.181.97.72]) by mx.google.com with ESMTPS id u123si4647716itc.36.2016.05.31.08.04.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 31 May 2016 08:04:08 -0700 (PDT) Subject: Re: [PATCH 6/6] mm, oom: fortify task_will_free_mem From: Tetsuo Handa References: <1464613556-16708-1-git-send-email-mhocko@kernel.org> <1464613556-16708-7-git-send-email-mhocko@kernel.org> In-Reply-To: <1464613556-16708-7-git-send-email-mhocko@kernel.org> Message-Id: <201606010003.CAH18706.LFHOFVOJtQOSFM@I-love.SAKURA.ne.jp> Date: Wed, 1 Jun 2016 00:03:53 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-linux-mm@kvack.org List-ID: To: mhocko@kernel.org, linux-mm@kvack.org Cc: rientjes@google.com, oleg@redhat.com, vdavydov@parallels.com, akpm@linux-foundation.org, mhocko@suse.com Michal Hocko wrote: > task_will_free_mem is rather weak. It doesn't really tell whether > the task has chance to drop its mm. 98748bd72200 ("oom: consider > multi-threaded tasks in task_will_free_mem") made a first step > into making it more robust for multi-threaded applications so now we > know that the whole process is going down and probably drop the mm. > > This patch builds on top for more complex scenarios where mm is shared > between different processes - CLONE_VM without CLONE_THREAD resp > CLONE_SIGHAND, or in kernel use_mm(). > > Make sure that all processes sharing the mm are killed or exiting. This > will allow us to replace try_oom_reaper by wake_oom_reaper. Therefore > all paths which bypass the oom killer are now reapable and so they > shouldn't lock up the oom killer. Really? The can_oom_reap variable was not removed before this patch. It means that oom_kill_process() might fail to call wake_oom_reaper() while setting TIF_MEMDIE to one of threads using that mm_struct. If use_mm() or global init keeps that mm_struct not OOM reapable, other threads sharing that mm_struct will get task_will_free_mem() == false, won't it? How is it guaranteed that task_will_free_mem() == false && oom_victims > 0 shall not lock up the OOM killer? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org