Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932181Ab1FQR6u (ORCPT ); Fri, 17 Jun 2011 13:58:50 -0400 Received: from casper.infradead.org ([85.118.1.10]:43475 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932100Ab1FQR6s (ORCPT ); Fri, 17 Jun 2011 13:58:48 -0400 Subject: Re: REGRESSION: Performance regressions from switching anon_vma->lock to mutex From: Peter Zijlstra 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" 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 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 23 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 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/