From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id 480AB6B0012 for ; Fri, 17 Jun 2011 13:58:51 -0400 (EDT) Received: from j77219.upc-j.chello.nl ([24.132.77.219] helo=dyad.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.76 #1 (Red Hat Linux)) id 1QXdJg-0008S1-6U for linux-mm@kvack.org; Fri, 17 Jun 2011 17:58:48 +0000 Subject: Re: REGRESSION: Performance regressions from switching anon_vma->lock to mutex From: Peter Zijlstra In-Reply-To: References: <1308097798.17300.142.camel@schen9-DESK> <1308101214.15392.151.camel@sli10-conroe> <1308138750.15315.62.camel@twins> <20110615161827.GA11769@tassilo.jf.intel.com> <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> Content-Type: text/plain; charset="UTF-8" Date: Fri, 17 Jun 2011 19:55:19 +0200 Message-ID: <1308333319.12801.15.camel@laptop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Linus Torvalds , 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" On Fri, 2011-06-17 at 10:41 -0700, Hugh Dickins wrote: > > The only thing I don't love about the batching is that we now do hold > > the lock over some situations where we _could_ have allowed > > concurrency (notably some avc allocations), but I think it's a good > > trade-off. And walking the list twice at unlink_anon_vmas() should be > > basically free. > > Applying load with those two patches applied (combined patch shown at > the bottom, in case you can tell me I misunderstood what to apply, > and have got the wrong combination on), lockdep very soon protested. Gah, of course. Its exactly the case Linus mentioned not loving. We can get reclaim recursion due to the avc allocation, we hold anon_vma->mutex while doing a (blocking) allocation, and reclaim can end up trying to obtain said lock trying to free some memory. Bugger. /me goes investigate -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org