From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 17 Oct 2008 18:08:05 -0700 (PDT) From: Linus Torvalds Subject: Re: [patch] mm: fix anon_vma races In-Reply-To: Message-ID: References: <20081016041033.GB10371@wotan.suse.de> <1224285222.10548.22.camel@lappy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Peter Zijlstra Cc: Nick Piggin , Hugh Dickins , Linux Memory Management List List-ID: On Fri, 17 Oct 2008, Linus Torvalds wrote: > > So maybe a better patch would be as follows? It simplifies the whole thing > by just always locking and unlocking the vma, whether it's newly allocated > or not (and whether it then gets dropped as unnecessary or not). Side note: it would be nicer if we had a "spin_lock_init_locked()", so that we could avoid the more expensive "true lock" when doing the initial allocation, but we don't. That said, the case of having to allocate a new anon_vma _should_ be the rare one. I dunno. Nick's approach of just depending on memory ordering for the list update probably works too. Even if it's rather more subtle than I'd like. Linus -- 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