From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754181Ab3A3JdZ (ORCPT ); Wed, 30 Jan 2013 04:33:25 -0500 Received: from mga02.intel.com ([134.134.136.20]:35357 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552Ab3A3JdX (ORCPT ); Wed, 30 Jan 2013 04:33:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,567,1355126400"; d="scan'208";a="278487106" Date: Wed, 30 Jan 2013 17:34:15 +0800 From: Yuanhan Liu To: Ingo Molnar Cc: Huang Ying , Linus Torvalds , David Howells , linux-kernel@vger.kernel.org, lkp@linux.intel.com Subject: Re: aim7 performance regression by commit 5a50508 report from LKP Message-ID: <20130130093415.GX12678@yliu-dev.sh.intel.com> References: <20130129082537.GS12678@yliu-dev.sh.intel.com> <20130129084400.GA5350@gmail.com> <20130129090620.GT12678@yliu-dev.sh.intel.com> <20130129091245.GB5775@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130129091245.GB5775@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2013 at 10:12:45AM +0100, Ingo Molnar wrote: > > * Yuanhan Liu wrote: > > > On Tue, Jan 29, 2013 at 09:44:00AM +0100, Ingo Molnar wrote: > > > > > > * Yuanhan Liu wrote: > > > > > > > [...] > > > > > > Very nice measurements and analysis, thanks! > > > > > > > As stated above, anybody can have a chance to own the lock in > > > > mutex once somebody release the lock. Well, there is only one > > > > to own the lock in rwsem write lock, and the one is known > > > > already: the one in the head of wait list. That would result > > > > to more contention in rwsem write lock case, especially if the > > > > one _will_ own the lock is not running now. > > > > > > I think we should allow lock-steal between rwsem writers - that > > > will not hurt fairness as most rwsem fairness concerns relate to > > > reader vs. writer fairness. > > > > Agreed, and I'm sure this will improve performance and may > > make this performance regression go away. > > > > David, is that Ok to you? If so, I may have a try. > > I'm not David but please try it :-) > > Making rwsem behavior and scalability similar to mutexes would > have numerous advantages. > > > > Am I correct to assume that all relevant users in this > > > workload are down_write() users? > > > > Yes, as commit 5a50508 just convert all mutex to down_write. > > A second track of inquiry would be to see whether any of the key > usage sites could be converted to down_read() I tried before, and seems I didn't find one. Well, I did find an irrelevant one: vma_lock_anon_vma at validate_mm() in mm/mmap.c. That function is _real_ only if CONFIG_DEBUG_VM_RB is set, and there is no vma_lock_anon_vma_read() or something similar, thus I guess it's may not worthy to turn it. > or whether the > lock hold times could be reduced drastically I also found one, but it doesn't sound like the one will reduce lock hole times drastically: vma_lock_anon_vma() seems covered too much code at expand_up/downwards. Well, again, it's quite a tiny optimization for reducing the coverage. Thanks. --yliu > - but I doubt > that's really possible on such heavily forking workloads. > > Thanks, > > Ingo