From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752426AbbCZQHv (ORCPT ); Thu, 26 Mar 2015 12:07:51 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60201 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbbCZQHp (ORCPT ); Thu, 26 Mar 2015 12:07:45 -0400 Date: Thu, 26 Mar 2015 17:07:42 +0100 From: Michal Hocko To: Johannes Weiner Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Andrew Morton , Tetsuo Handa , Huang Ying , Andrea Arcangeli , Dave Chinner , "Theodore Ts'o" Subject: Re: [patch 06/12] mm: oom_kill: simplify OOM killer locking Message-ID: <20150326160742.GR15257@dhcp22.suse.cz> References: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> <1427264236-17249-7-git-send-email-hannes@cmpxchg.org> <20150326133111.GJ15257@dhcp22.suse.cz> <20150326151746.GC23973@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150326151746.GC23973@cmpxchg.org> 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 26-03-15 11:17:46, Johannes Weiner wrote: > On Thu, Mar 26, 2015 at 02:31:11PM +0100, Michal Hocko wrote: [...] > > > @@ -795,27 +728,21 @@ bool out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, > > > */ > > > void pagefault_out_of_memory(void) > > > { > > > - struct zonelist *zonelist; > > > - > > > - down_read(&oom_sem); > > > if (mem_cgroup_oom_synchronize(true)) > > > - goto unlock; > > > + return; > > > > OK, so we are back to what David has asked previously. We do not need > > the lock for memcg and oom_killer_disabled because we know that no tasks > > (except for potential oom victim) are lurking around at the time > > oom_killer_disable() is called. So I guess we want to stick a comment > > into mem_cgroup_oom_synchronize before we check for oom_killer_disabled. > > I would prefer everybody that sets TIF_MEMDIE and kills a task to hold > the lock, including memcg. Simplicity is one thing, but also a global > OOM kill might not even be necessary when it's racing with the memcg. sure I am find with that. > > After those are fixed, feel free to add > > Acked-by: Michal Hocko > > Thanks. -- Michal Hocko SUSE Labs