Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758995Ab1FQWUe (ORCPT ); Fri, 17 Jun 2011 18:20:34 -0400 Received: from smtp-out.google.com ([74.125.121.67]:14786 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756179Ab1FQWUd (ORCPT ); Fri, 17 Jun 2011 18:20:33 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=R0ia8FoV7+o23vLhCKkeza/he3x0BAw/ytdhjxY3l5cRjO1hDg6wQgeatzDzxwtfGD rOJg6c74knBSg4/awQbg== Date: Fri, 17 Jun 2011 15:20:14 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@sister.anvils To: Linus Torvalds cc: Peter Zijlstra , Hugh Dickins , Tim Chen , Andi Kleen , Shaohua Li , Andrew Morton , KOSAKI Motohiro , Benjamin Herrenschmidt , David Miller , Martin Schwidefsky , Russell King , Paul Mundt , Jeff Dike , Richard Weinberger , "Luck, Tony" , KAMEZAWA Hiroyuki , Mel Gorman , Nick Piggin , Namhyung Kim , "Shi, Alex" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "Rafael J. Wysocki" Subject: Re: REGRESSION: Performance regressions from switching anon_vma->lock to mutex In-Reply-To: Message-ID: References: <1308097798.17300.142.camel@schen9-DESK> <1308156337.2171.23.camel@laptop> <1308163398.17300.147.camel@schen9-DESK> <1308169937.15315.88.camel@twins> <4DF91CB9.5080504@linux.intel.com> <1308172336.17300.177.camel@schen9-DESK> <1308173849.15315.91.camel@twins> <1308255972.17300.450.camel@schen9-DESK> <1308310080.2355.19.camel@twins> <1308334688.12801.19.camel@laptop> <1308335557.12801.24.camel@laptop> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1631 Lines: 38 On Fri, 17 Jun 2011, Linus Torvalds wrote: > On Fri, Jun 17, 2011 at 11:32 AM, Peter Zijlstra wrote: > > > > something like so I guess, completely untested etc.. > > Having gone over it a bit more, I actually think I prefer to just > special-case the allocation instead. > > We already have to drop the anon_vma lock for the "out of memory" > case, and a slight re-organization of clone_anon_vma() makes it easy > to just first try a NOIO allocation with the lock still held, and then > if that fails do the "drop lock, retry, and hard-fail" case. > > IOW, something like the attached (on top of the patches already posted > except for your memory reclaim thing) > > Hugh, does this fix the lockdep issue? Yes, that fixed the lockdep issue, and ran nicely under load for an hour. I agree that it's better to do this GFP_NOWAIT and fallback, than trylock the anon_vma. And I'm happy that you've still got that WARN_ON_ONCE(root) in: I do not have a fluid mental model of the anon_vma_chains, get lost there; and though it's obvious that we must have the same anon_vma->root going down the same_anon_vma list, I could not put my finger on a killer demonstration for why the same has to be true of the same_vma list. But I've not seen your WARN_ON_ONCE fire, and it's hard to imagine how there could be more than one root in the whole bundle of lists. Hugh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/