Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754785Ab3I3BLR (ORCPT ); Sun, 29 Sep 2013 21:11:17 -0400 Received: from mail-qa0-f51.google.com ([209.85.216.51]:48103 "EHLO mail-qa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754509Ab3I3BLP (ORCPT ); Sun, 29 Sep 2013 21:11:15 -0400 MIME-Version: 1.0 In-Reply-To: References: <1380308424-31011-1-git-send-email-Waiman.Long@hp.com> <20130928074144.GA17773@gmail.com> Date: Sun, 29 Sep 2013 18:11:13 -0700 Message-ID: Subject: Re: [PATCH] rwsem: reduce spinlock contention in wakeup code path From: Michel Lespinasse To: Linus Torvalds Cc: Ingo Molnar , Waiman Long , Ingo Molnar , Andrew Morton , Linux Kernel Mailing List , Rik van Riel , Peter Hurley , Davidlohr Bueso , Alex Shi , Tim Chen , Peter Zijlstra , Andrea Arcangeli , Matthew R Wilcox , Dave Hansen , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" 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: 1476 Lines: 32 On Sat, Sep 28, 2013 at 11:55 AM, Linus Torvalds wrote: > Btw, I really hate that thing. I think we should turn it back into a > spinlock. None of what it protects needs a mutex or an rwsem. > > Because you guys talk about the regression of turning it into a rwsem, > but nobody talks about the *original* regression. > > And it *used* to be a spinlock, and it was changed into a mutex back > in 2011 by commit 2b575eb64f7a. That commit doesn't even have a reason > listed for it, although my dim memory of it is that the reason was > preemption latency. I was wondering about that too. Regarding latencies, we used to have unbounded latencies for anon_vma operations as the AVC chains could get long under some workloads; now that we index the VMAs matching a given anon_vma with an interval tree this particular source of latencies should be gone. So yes, it could be worth trying to go back to a non-sleeping lock. That said, I am very scared of using rwlock_t here, and I would much prefer we choose a fair lock (either spinlock or a new rwlock implementation which guarantees not to starve any locker thread) -- Michel Lespinasse A program is never fully debugged until the last user dies. -- 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/