• Liam R. Howlett's avatar
    maple_tree: add hex output to maple_arange64 dump · 83d97f62
    Liam R. Howlett authored
    Patch series "maple_tree: Change replacement strategy".
    
    The maple tree marks nodes dead as soon as they are going to be replaced. 
    This could be problematic when used in the RCU context since the writer
    may be starved of CPU time by the readers.  This patch set addresses the
    issue by switching the data replacement strategy to one that will only
    mark data as dead once the new data is available.
    
    This series changes the ordering of the node replacement so that the new
    data is live before the old data is marked 'dead'.  When readers hit
    'dead' nodes, they will restart from the top of the tree and end up in the
    new data.
    
    In more complex scenarios, the replacement strategy means a subtree is
    built and graphed into the tree leaving some nodes to point to the old
    parent.  The view of tasks into the old data will either remain with the
    old data, or see the new data once the old data is marked 'dead'.
    
    Iterators will see the 'dead' node and restart on their own and switch to
    the new data.  There is no risk of the reader seeing old data in these
    cases.
    
    The 'dead' subtree of data is then fully marked dead, but reused nodes
    will still point to the dead nodes until the parent pointer is updated. 
    Walking up to a 'dead' node will cause a re-walk from the top of the tree
    and enter the new data area where old data is not reachable.
    
    Once the parent pointers are fully up to date in the active data, the
    'dead' subtree is iterated to collect entirely 'dead' subtrees, and dead
    nodes (nodes that partially contained reused data).
    
    
    This patch (of 6):
    
    When dumping the tree, honour formatting request to output hex for the
    maple node type arange64.
    
    Link: https://lkml.kernel.org/r/20230804165951.2661157-1-Liam.Howlett@oracle.com
    Link: https://lkml.kernel.org/r/20230804165951.2661157-2-Liam.Howlett@oracle.comSigned-off-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Paul E. McKenney <paulmck@kernel.org>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    83d97f62
maple_tree.c 182 KB