lkml.org 
[lkml]   [2017]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/9] rbtree: Cache leftmost node internally
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

\
 
 \ /
  Last update: 2017-07-15 17:29    [W:0.432 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site