Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S971453AbdDTRNl (ORCPT ); Thu, 20 Apr 2017 13:13:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:51551 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1033518AbdDTRNh (ORCPT ); Thu, 20 Apr 2017 13:13:37 -0400 Date: Thu, 20 Apr 2017 10:13:26 -0700 From: Davidlohr Bueso To: Peter Zijlstra 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: <20170420171326.GD20746@linux-80c1.suse> References: <20170406084620.22700-1-dave@stgolabs.net> <20170419123735.GB5730@worktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170419123735.GB5730@worktop> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 788 Lines: 17 On Wed, 19 Apr 2017, Peter Zijlstra wrote: > - explain why the loss of lock stealing makes sense. IIRC walken added > that specifically to address mmap_sem performance issues. That's right, and the same applies to the writer spinning stuff; which can makes a huge difference - more so than plain stealing. But as I've mentioned, range locks can improve parallelism, which is/should be much more welcomed than optimizations to the primitive. So yeah, we loose in comparing a full range to rwsem (not to mention the xadd stuff). 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. Thanks, Davidlohr