From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085AbbCZPEa (ORCPT ); Thu, 26 Mar 2015 11:04:30 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:51123 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752862AbbCZPE2 (ORCPT ); Thu, 26 Mar 2015 11:04:28 -0400 Date: Thu, 26 Mar 2015 11:04:18 -0400 From: Johannes Weiner To: Michal Hocko 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 04/12] mm: oom_kill: remove unnecessary locking in exit_oom_victim() Message-ID: <20150326150418.GA23973@cmpxchg.org> References: <1427264236-17249-1-git-send-email-hannes@cmpxchg.org> <1427264236-17249-5-git-send-email-hannes@cmpxchg.org> <20150326125348.GF15257@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150326125348.GF15257@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2015 at 01:53:48PM +0100, Michal Hocko wrote: > On Wed 25-03-15 02:17:08, Johannes Weiner wrote: > > Right now the only waiter is suspend code, which achieves quiescence > > by disabling the OOM killer. But later on we want to add waits that > > hold the lock instead to stop new victims from showing up. > > It is not entirely clear what you mean by this from the current context. > exit_oom_victim is not called from any context which would be locked by > any OOM internals so it should be safe to use the locking. A later patch will add another wait_event() to wait for oom victims to drop to zero. But that new consumer won't be disabling the OOM killer to prevent new victims from showing up, it will just hold the lock to exclude OOM kills. So the exiting victims shouldn't get stuck on that lock which the guy that is waiting for them is holding.