From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with SMTP id 6E0076B0055 for ; Wed, 26 Aug 2009 15:57:53 -0400 (EDT) Date: Wed, 26 Aug 2009 20:57:27 +0100 (BST) From: Hugh Dickins Subject: Re: [PATCH 13/12] ksm: fix munlock during exit_mmap deadlock In-Reply-To: <20090826194444.GB14722@random.random> Message-ID: References: <20090825145832.GP14722@random.random> <20090825152217.GQ14722@random.random> <20090825181019.GT14722@random.random> <20090825194530.GU14722@random.random> <20090826194444.GB14722@random.random> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli Cc: Izik Eidus , Rik van Riel , Chris Wright , Nick Piggin , Andrew Morton , "Justin M. Forbes" , linux-kernel@vger.kernel.org, linux-mm@kvack.org List-ID: On Wed, 26 Aug 2009, Andrea Arcangeli wrote: > > All is left to address is to teach page_alloc.c that the mm is going > away in a second patch. That might also help when it's aio triggering > gup page allocations or other kernel threads with use_mm just like ksm > and the oom killer selected those "mm" for release. > > Having ksm using use_mm before triggering the handle_mm_fault (so > tsk->mm points to the mm of the task) and adding a MMF_MEMDIE to > mm->flags checked by page_alloc would work just fine and should solve > the double task killed... but then I'm unsure.. this is just the first > idea I had. Yes, I began to have thoughts along those lines too as I was writing my reply. It is a different angle on the problem, I hadn't looked at it that way before, and it does seem worth pursuing. MMF_MEMDIE, yes, that might be useful. But KSM_RUN_UNMERGE wouldn't be able to use_mm since it's coming from a normal user process - perhaps it should be a kill-me-first like swapoff via PF_SWAPOFF. Hugh -- 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