Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649Ab3JAIKH (ORCPT ); Tue, 1 Oct 2013 04:10:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:59401 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377Ab3JAIKE (ORCPT ); Tue, 1 Oct 2013 04:10:04 -0400 Date: Tue, 1 Oct 2013 10:09:21 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: Linus Torvalds , Waiman Long , Ingo Molnar , Andrew Morton , Linux Kernel Mailing List , Rik van Riel , Peter Hurley , Davidlohr Bueso , Alex Shi , Tim Chen , Andrea Arcangeli , Matthew R Wilcox , Dave Hansen , Michel Lespinasse , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Subject: Re: [PATCH] rwsem: reduce spinlock contention in wakeup code path Message-ID: <20131001080921.GL3081@twins.programming.kicks-ass.net> References: <1380308424-31011-1-git-send-email-Waiman.Long@hp.com> <20130928074144.GA17773@gmail.com> <20130928192123.GA8228@gmail.com> <20130930104408.GW3081@twins.programming.kicks-ass.net> <20130930164141.GH3081@twins.programming.kicks-ass.net> <20131001072815.GA20261@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131001072815.GA20261@gmail.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 907 Lines: 37 On Tue, Oct 01, 2013 at 09:28:15AM +0200, Ingo Molnar wrote: > That I mostly agree with, except that without a serious usecase do we have > a guarantee that bugs in fancies queueing in rwsems gets ironed out? Methinks mmap_sem is still a big enough lock to work out a locking primitive :-) In fact, try something like this from userspace: n-threads: pthread_mutex_lock(&mutex); foo = mmap(); pthread_mutex_lock(&mutex); /* work */ pthread_mutex_unlock(&mutex); munma(foo); pthread_mutex_unlock(&mutex); vs n-threads: foo = mmap(); /* work */ munmap(foo); I've had reports that the former was significantly faster than the latter. -- 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/