From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbdHAOrx (ORCPT ); Tue, 1 Aug 2017 10:47:53 -0400 Received: from mx2.suse.de ([195.135.220.15]:42970 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751166AbdHAOrw (ORCPT ); Tue, 1 Aug 2017 10:47:52 -0400 Date: Tue, 1 Aug 2017 16:47:49 +0200 From: Michal Hocko To: Tetsuo Handa Cc: mjaggi@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: Possible race condition in oom-killer Message-ID: <20170801144749.GA15780@dhcp22.suse.cz> References: <20170728132952.GQ2274@dhcp22.suse.cz> <201707282255.BGI87015.FSFOVQtMOHLJFO@I-love.SAKURA.ne.jp> <20170728140706.GT2274@dhcp22.suse.cz> <201707291331.JGI18780.OtJVLFMHFOFSOQ@I-love.SAKURA.ne.jp> <20170801121411.GG15774@dhcp22.suse.cz> <201708012316.CFF21387.VMFtLFJHFOQOOS@I-love.SAKURA.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201708012316.CFF21387.VMFtLFJHFOQOOS@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 Tue 01-08-17 23:16:13, Tetsuo Handa wrote: > Michal Hocko wrote: > > Once we merge [1] then the oom victim wouldn't > > need to get TIF_MEMDIE to access memory reserves. > > > > [1] http://lkml.kernel.org/r/20170727090357.3205-2-mhocko@kernel.org > > False. We are not setting oom_mm to all thread groups (!CLONE_THREAD) sharing > that mm (CLONE_VM). Thus, one thread from each thread group sharing that mm > will have to call out_of_memory() in order to set oom_mm, and they will find > task_will_free_mem() returning false due to MMF_OOM_SKIP already set, and > after all goes to next OOM victim selection. Once the patch is merged we can mark_oom_victim all of them as well. -- Michal Hocko SUSE Labs