maple_tree: iterator state changes
Status from this message: [merged mm-stable] maple_tree-mtree_range_walk-clean-up.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 12 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | maple_tree: Remove unnecessary default labels from switch statementslib/ | +2 | 0 replies | Applied |
| 2/12 | maple_tree: Make mas_erase() more robustlib/ | +1 | 0 replies | Applied |
| 3/12 | maple_tree: Move debug check to __mas_set_range()include/ mm/ tools/ | +130 | 0 replies | Applied |
| 4/12 | maple_tree: Add end of node tracking to the maple stateinclude/ lib/ tools/ | +9 | 0 replies | Applied |
| 5/12 | maple_tree: Use cached node end in mas_next()lib/ | +8 | 0 replies | Applied |
| 6/12 | maple_tree: Use cached node end in mas_destroy()lib/ | +1 | 0 replies | Applied |
| 7/12 | maple_tree: Clean up inlines for some functionslib/ | +39 | 0 replies | Applied |
| 8/12 | maple_tree: Separate ma_state node from status.include/ include/ lib/ +3 more | +415 | 5 replies | Applied |
| 9/12 | maple_tree: Remove mas_searchable()lib/ tools/ | +19 | 0 replies | Applied |
| 10/12 | maple_tree: Use maple state end for write operationsinclude/ lib/ | +24 | 0 replies | Applied |
| 11/12 | maple_tree: Don't find node end in mtree_lookup_walk()lib/ lib/ | +24 | 0 replies | Applied |
| 12/12 | maple_tree: mtree_range_walk() clean uplib/ | +12 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/12] maple_tree: iterator state changes
Andrew,
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/[email protected]/T/#u
Liam R. Howlett (12):
maple_tree: Remove unnecessary default labels from switch statements
maple_tree: Make mas_erase() more robust
maple_tree: Move debug check to __mas_set_range()
maple_tree: Add end of node tracking to the maple state
maple_tree: Use cached node end in mas_next()
maple_tree: Use cached node end in mas_destroy()
maple_tree: Clean up inlines for some functions
maple_tree: Separate ma_state node from status.
maple_tree: Remove mas_searchable()
maple_tree: Use maple state end for write operations
maple_tree: Don't find node end in mtree_lookup_walk()
maple_tree: mtree_range_walk() clean up
include/linux/maple_tree.h | 342 +++++----- include/linux/mm_types.h | 3 +- lib/maple_tree.c | 680 +++++++++++--------- lib/test_maple_tree.c | 201 +++--- mm/internal.h | 10 +- tools/testing/radix-tree/linux/maple_tree.h | 2 +- tools/testing/radix-tree/maple.c | 27 +- 7 files changed, 679 insertions(+), 586 deletions(-)
Signature · 1 line
2.40.1