Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755032Ab3I3QNy (ORCPT ); Mon, 30 Sep 2013 12:13:54 -0400 Received: from mail-ve0-f169.google.com ([209.85.128.169]:32972 "EHLO mail-ve0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638Ab3I3QNx (ORCPT ); Mon, 30 Sep 2013 12:13:53 -0400 MIME-Version: 1.0 In-Reply-To: <20130930104408.GW3081@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> Date: Mon, 30 Sep 2013 09:13:52 -0700 X-Google-Sender-Auth: rJC9LSmhfgHzwB2mAU6gAJERGCM Message-ID: Subject: Re: [PATCH] rwsem: reduce spinlock contention in wakeup code path From: Linus Torvalds To: Peter Zijlstra Cc: Ingo Molnar , 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" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1445 Lines: 29 On Mon, Sep 30, 2013 at 3:44 AM, Peter Zijlstra wrote: > On Sat, Sep 28, 2013 at 12:33:36PM -0700, Linus Torvalds wrote: >> The old rwlock's really have been a disappointment - they are slower >> than spinlocks, and seldom/never end up scaling any better. Their >> main advantage was literally the irq behavior - allowing readers to >> happen without the expense of worrying about irq's. > > So in part that is fundamental to the whole rw-spinlock concept. No, I agree. But it's really just that our rwlock implementation isn't very good. It's neither really high-performing nor fair, and the premise of a rw-lock is that it should scale better than a spinlock. And yes, under heavy reader activity *does* work out for that (ok, you get cacheline bouncing, but at least you don't get the spinning when you have tons of readers), the extreme unfairness towards writers under heavy reader activity makes it often simply unacceptable. So unlike a lot of other "let's try to make our locking fancy" that I dislike because it tends to hide the fundamental problem of contention, the rwlock patches make me go "those actually _fix_ a fundamental problem". 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/