From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753375Ab3KRSqw (ORCPT ); Mon, 18 Nov 2013 13:46:52 -0500 Received: from one.firstfloor.org ([193.170.194.197]:52170 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433Ab3KRSqq (ORCPT ); Mon, 18 Nov 2013 13:46:46 -0500 Date: Mon, 18 Nov 2013 19:46:44 +0100 From: Andi Kleen To: Linus Torvalds Cc: Andi Kleen , Waiman Long , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , "linux-arch@vger.kernel.org" , the arch/x86 maintainers , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andrew Morton , Michel Lespinasse , Rik van Riel , "Paul E. McKenney" , Raghavendra K T , George Spelvin , Tim Chen , Aswin Chandramouleeswaran , Scott J Norton Subject: Re: [PATCH v6 3/5] qrwlock: Enable fair queue read/write lock Message-ID: <20131118184644.GC29695@two.firstfloor.org> References: <1384267735-43213-1-git-send-email-Waiman.Long@hp.com> <1384267735-43213-5-git-send-email-Waiman.Long@hp.com> <20131118183433.GB29695@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Why would it make sense here? There may be cases were switching all read locks to unfair may make concerete workloads slower. The effect is very visible in (non kernel) lock micro benchmarks, especially with HyperThreading. With very high contention or long enough critical sections the ordered lock usually wins, but it loses with lower contention. Unfortunately the "small critical section" case (even though it's really bad for any contended lock) is reasonably common :-/ [IMHO all of these should be fixed or "batched" somehow, but in some cases it is quite hard] However ordered locks definitely have more consistent performance. If prioritizing consistency over potential slow down in some cases is fine only having the ordered option is ok. -Andi