From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx144.postini.com [74.125.245.144]) by kanga.kvack.org (Postfix) with SMTP id 5B4EA6B0062 for ; Thu, 1 Nov 2012 18:43:08 -0400 (EDT) Date: Thu, 1 Nov 2012 15:43:06 -0700 From: Andrew Morton Subject: Re: [patch] mm, oom: allow exiting threads to have access to memory reserves Message-Id: <20121101154306.c0871efb.akpm@linux-foundation.org> In-Reply-To: References: <20121030001809.GL15767@bbox> <20121031005738.GM15767@bbox> <20121101024316.GB24883@bbox> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Luigi Semenzato , Minchan Kim , Mel Gorman , linux-mm@kvack.org, Dan Magenheimer , KOSAKI Motohiro , Sonny Rao On Thu, 1 Nov 2012 14:58:18 -0700 (PDT) David Rientjes wrote: > Exiting threads, those with PF_EXITING set, can pagefault and require > memory before they can make forward progress. This happens, for instance, > when a process must fault task->robust_list, a userspace structure, before > detaching its memory. > > These threads also aren't guaranteed to get access to memory reserves > unless oom killed or killed from userspace. The oom killer won't grant > memory reserves if other threads are also exiting other than current and > stalling at the same point. This prevents needlessly killing processes > when others are already exiting. > > Instead of special casing all the possible sitations between PF_EXITING > getting set and a thread detaching its mm where it may allocate memory, > which probably wouldn't get updated when a change is made to the exit > path, the solution is to give all exiting threads access to memory > reserves if they call the oom killer. This allows them to quickly > allocate, detach its mm, and free the memory it represents. Seems very sensible. > Acked-by: Minchan Kim > Tested-by: Luigi Semenzato What did Luigi actually test? Was there some reproducible bad behavior which this patch fixes? -- 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