• Liam R. Howlett's avatar
    maple_tree: remove unnecessary default labels from switch statements · 37a8ab24
    Liam R. Howlett authored
    Patch series "maple_tree: iterator state changes".
    
    These patches have some general cleanup and a change to separate the maple
    state status tracking from the maple state node.
    
    The maple state status change allows for walks to continue from previous
    places when the status needs to be recorded to make logical sense for the
    next call to the maple state.  For instance, it allows for prev/next to
    function in a way that better resembles the linked list.  It also allows
    switch statements to be used to detect missed states during compile, and
    the addition of fast-path "active" state is cleaner as an enum.
    
    While making the status change, perf showed some very small (one line)
    functions that were not inlined even with the inline key word.  Making
    these small functions __always_inline is less expensive according to perf.
    As part of that change, some inlines have been dropped from larger
    functions.
    
    Perf also showed that the commonly used mas_for_each() iterator was
    spending a lot of time finding the end of the node.  This series
    introduces caching of the end of the node in the maple state (and updating
    it during writes).  This caching along with the inline changes yielded at
    23.25% improvement on the BENCH_MAS_FOR_EACH maple tree test framework
    benchmark.
    
    I've also included a change to mtree_range_walk and mtree_lookup_walk to
    take advantage of Peng's change [1] to the initial pivot setup.
    
    mmtests did not produce any significant gains.
    
    [1] https://lore.kernel.org/all/20230711035444.526-1-zhangpeng.00@bytedance.com/T/#u
    
    
    This patch (of 12):
    
    Removing the default types from the switch statements will cause compile
    warnings on missing cases.
    
    Link: https://lkml.kernel.org/r/20231101171629.3612299-2-Liam.Howlett@oracle.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
    Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    37a8ab24
maple_tree.c 189 KB