Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758456Ab1FQQtm (ORCPT ); Fri, 17 Jun 2011 12:49:42 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:58448 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758071Ab1FQQtk (ORCPT ); Fri, 17 Jun 2011 12:49:40 -0400 MIME-Version: 1.0 In-Reply-To: <1308310080.2355.19.camel@twins> 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> From: Linus Torvalds Date: Fri, 17 Jun 2011 09:36:48 -0700 Message-ID: Subject: Re: REGRESSION: Performance regressions from switching anon_vma->lock to mutex To: Peter Zijlstra Cc: Tim Chen , Andi Kleen , Shaohua Li , Andrew Morton , Hugh Dickins , 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" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1324 Lines: 32 On Fri, Jun 17, 2011 at 4:28 AM, Peter Zijlstra wrote: > > Something like so? Compiles and runs the benchmark in question. Yup. Except I really think that test for a NULL anon_vma should go away. If an avc entry has a NULL anon_vma, something is seriously wrong. The comment about anon_vma_fork failure is definitely just bogus: the anon_vma is allocated before the avc entry, so there's no way a avc can have a NULL anon_vma from there. But yes, your patch is cleaner than the one I was playing around with (your "remove if not list empty" is prettier than what I was toying with - having a separate flag in the avc) Tim, can you test Peter's (second - the cleaned up one) patch on top of mine, and see if that helps things further? 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. Linus -- 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/