Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033606AbdDTRyD (ORCPT ); Thu, 20 Apr 2017 13:54:03 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:50107 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033591AbdDTRx7 (ORCPT ); Thu, 20 Apr 2017 13:53:59 -0400 Date: Thu, 20 Apr 2017 19:53:50 +0200 From: Peter Zijlstra To: Davidlohr Bueso Cc: mingo@kernel.org, akpm@linux-foundation.org, jack@suse.cz, kirill.shutemov@linux.intel.com, ldufour@linux.vnet.ibm.com, mhocko@suse.com, mgorman@techsingularity.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 -tip 0/6] locking: Introduce range reader/writer lock Message-ID: <20170420175350.44mvhizyulyzb6oc@hirez.programming.kicks-ass.net> References: <20170406084620.22700-1-dave@stgolabs.net> <20170419123735.GB5730@worktop> <20170420171326.GD20746@linux-80c1.suse> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170420171326.GD20746@linux-80c1.suse> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 625 Lines: 13 On Thu, Apr 20, 2017 at 10:13:26AM -0700, Davidlohr Bueso wrote: > I have thought of some heuristics for avoiding sleeping under certain > constraints, which could mitigate the spinning step we loose, but I fear it > will never be exactly as fast as rwsems -- just consider > we always take the tree->lock. But tree->lock is a spinlock, so while this gets us out of rwsem-xadd territory for the fast paths, the whole lock-stealing and optimistic spinning stuff is on a different scale. Those are about avoiding actually going to sleep and having to be woken up (and waiting to become running) again, which is a long time.