Skip to content
  • Davidlohr Bueso's avatar
    rbtree: cache leftmost node internally · cd9e61ed
    Davidlohr Bueso authored
    Patch series "rbtree: Cache leftmost node internally", v4.
    
    A series to extending rbtrees to internally cache the leftmost node such
    that we can have fast overlap check optimization for all interval tree
    users[1].  The benefits of this series are that:
    
    (i)   Unify users that do internal leftmost node caching.
    (ii)  Optimize all interval tree users.
    (iii) Convert at least two new users (epoll and procfs) to the new interface.
    
    This patch (of 16):
    
    Red-black tree semantics imply that nodes with smaller or greater (or
    equal for duplicates) keys always be to the left and right,
    respectively.  For the kernel this is extremely evident when considering
    our rb_first() semantics.  Enabling lookups for the smallest node in the
    tree in O(1) can save a good chunk of cycles in not having to walk down
    the tree each time.  To this end there are a few core users that
    explicitly do this, such as the scheduler and rtmutexes.  There is also
    the desire for interval trees to have this o...
    cd9e61ed