Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751180AbdGOP26 (ORCPT ); Sat, 15 Jul 2017 11:28:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:45444 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751066AbdGOP25 (ORCPT ); Sat, 15 Jul 2017 11:28:57 -0400 Date: Sat, 15 Jul 2017 08:28:41 -0700 From: Davidlohr Bueso To: Christoph Hellwig Cc: mingo@kernel.org, peterz@infradead.org, akpm@linux-foundation.org, torvalds@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, Davidlohr Bueso Subject: Re: [PATCH 1/9] rbtree: Cache leftmost node internally Message-ID: <20170715152841.GA14395@linux-80c1.suse> References: <20170629171553.2146-1-dave@stgolabs.net> <20170629171553.2146-2-dave@stgolabs.net> <20170715105433.GA31814@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20170715105433.GA31814@infradead.org> 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: 761 Lines: 21 On Sat, 15 Jul 2017, Christoph Hellwig wrote: >Is the leftmost node so much more special than the rightmost one? > >Just asking because I have some code that caches both of them, but >using your helpers would make it look very asymmetric.. Yeah, I thought of this, but ultimately decided that the leftmost node was more used (rb_first vs rb_last calls) and probably not worth adding the rightmost one which would endup enlarging the structure even more. That said, I do have some patches for the rbtree users to cache the rightmost node, similarly to how it was done with the leftmost before this patchset. If folks don't mind enlarging rb_root_cached, I could definitely add the rightmost, but it seems an overkill -- albeit asymmetric. Thanks, Davidlohr