From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbbCSWKY (ORCPT ); Thu, 19 Mar 2015 18:10:24 -0400 Received: from casper.infradead.org ([85.118.1.10]:35313 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbbCSWKW (ORCPT ); Thu, 19 Mar 2015 18:10:22 -0400 Date: Thu, 19 Mar 2015 23:10:21 +0100 From: Peter Zijlstra To: Andrew Morton Cc: mingo@kernel.org, rusty@rustcorp.com.au, mathieu.desnoyers@efficios.com, oleg@redhat.com, paulmck@linux.vnet.ibm.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, andi@firstfloor.org, rostedt@goodmis.org, tglx@linutronix.de, Michel Lespinasse , Andrea Arcangeli , David Woodhouse , Rik van Riel Subject: Re: [PATCH 6/8] rbtree: Implement generic latch_tree Message-ID: <20150319221021.GT2896@worktop.programming.kicks-ass.net> References: <20150318133626.526984618@infradead.org> <20150318134631.939369528@infradead.org> <20150318221446.14b0b04d.akpm@linux-foundation.org> <20150319072502.GR23123@twins.programming.kicks-ass.net> <20150319135833.5a844744936bd8fdafea7ed5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150319135833.5a844744936bd8fdafea7ed5@linux-foundation.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 19, 2015 at 01:58:33PM -0700, Andrew Morton wrote: > On Thu, 19 Mar 2015 08:25:02 +0100 Peter Zijlstra wrote: > > > On Wed, Mar 18, 2015 at 10:14:46PM -0700, Andrew Morton wrote: > > > On Wed, 18 Mar 2015 14:36:32 +0100 Peter Zijlstra wrote: > > > > > > > include/linux/rbtree_latch.h | 223 +++++++++++++++++++++++++++++++++++++++++++ > > > > > > Did it really need to all be inlined? > > > > Without that you get actual function calls to the less() and comp() > > operators. This way GCC can inline the lot even though its function > > pointers. > > > > The typical RB tree user open-codes all this every single time. > > Is it a good tradeoff? Is what? Writing it like this or open-coding it all? For many archs (indirect) function calls are far more expensive than the typical comparison.