Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756057AbbDIRMN (ORCPT ); Thu, 9 Apr 2015 13:12:13 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:34936 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753428AbbDIRMI (ORCPT ); Thu, 9 Apr 2015 13:12:08 -0400 MIME-Version: 1.0 In-Reply-To: <20150409165917.GQ21418@twins.programming.kicks-ass.net> References: <20150408164813.810874878@infradead.org> <20150408170044.130755544@infradead.org> <552633A3.5020502@cn.fujitsu.com> <20150409081420.GM5029@twins.programming.kicks-ass.net> <55263E69.3020305@cn.fujitsu.com> <20150409121336.GU5029@twins.programming.kicks-ass.net> <20150409165917.GQ21418@twins.programming.kicks-ass.net> Date: Thu, 9 Apr 2015 10:12:07 -0700 X-Google-Sender-Auth: kksgSRnH5mevgcDpvmOSV_iZEsc Message-ID: Subject: Re: [PATCH v4 6/9] rbtree: Implement generic latch_tree From: Linus Torvalds To: Peter Zijlstra Cc: Lai Jiangshan , Ingo Molnar , Rusty Russell , Mathieu Desnoyers , Oleg Nesterov , Paul McKenney , Linux Kernel Mailing List , Andi Kleen , Steven Rostedt , Thomas Gleixner , Michel Lespinasse , Andrea Arcangeli , David Woodhouse , Rik van Riel 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: 984 Lines: 23 On Thu, Apr 9, 2015 at 9:59 AM, Peter Zijlstra wrote: > > I was a little surprised myself it worked, but its a constant after > all so it 'should'. Well, it should actually work for non-constants too, even when that 'idx' isn't inlined to one of the fixed constants. So even if this will ever hit the "seq & 1" case for lookup, it should all work. It's just an expression, after all. All that is really required is that you can do '&(x->y)' on it, where 'x' is the type, and 'y' is the "member". It's just unusual, which I think makes it slightly harder to read for a *human* just because it breaks the normal pattern of those things. But there's nothing technically wrong with it. 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/