Skip to content

Maple tree mas_{next,prev}_range() and cleanup

Liam R. Howlett linux-kselftest linux-mm lkml 4 versions – Applied

Status from this message: [merged mm-stable] mm-avoid-rewalk-in-mmap_region.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest35 patches 5 repliesApplied 35/35
  2. v335 patches 2 repliesSuperseded
  3. v236 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v134 patches24 repliesSuperseded

Changes in v4 from the cover letter

- Fixed whitespace issue in mas_find() - Thanks build bot
- Dropped mas_contiguous() until a user is implemented and it will be renamed - Thanks Andrew Morton
- Added missing comment to patch 34 "Add vma_iter_{next,prev}_range()"

Patches in v4 All 35 applied

#Subject and filesSizeRepliesApplied
1/35maple_tree: Fix static analyser cppcheck issuelib/maple_tree.c+3 -20 repliesApplied
2/35maple_tree: Clean up mas_parent_enum() and rename to mas_parent_type()lib/maple_tree.c+22 -280 repliesApplied
3/35maple_tree: Avoid unnecessary ascendinglib/maple_tree.c tools/testing/radix-tree/maple.c+12 -30 repliesApplied
4/35maple_tree: Clean up mas_dfs_postorder()lib/maple_tree.c+2 -50 repliesApplied
5/35maple_tree: Add format option to mt_dump()include/linux/maple_tree.h lib/maple_tree.c lib/test_maple_tree.c +3 more+82 -480 repliesApplied
6/35maple_tree: Add debug BUG_ON and WARN_ON variantsinclude/linux/maple_tree.h lib/maple_tree.c+129 -50 repliesApplied
7/35maple_tree: Convert BUG_ON() to MT_BUG_ON()lib/maple_tree.c+1 -10 repliesApplied
8/35maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON()include/linux/maple_tree.h+2 -20 repliesApplied
9/35maple_tree: Convert debug code to use MT_WARN_ON() and MAS_WARN_ON()lib/maple_tree.c+14 -160 repliesApplied
10/35maple_tree: Use MAS_BUG_ON() when setting a leaf node as a parentlib/maple_tree.c+13 -130 repliesApplied
11/35maple_tree: Use MAS_BUG_ON() in mas_set_height()lib/maple_tree.c+1 -10 repliesApplied
12/35maple_tree: Use MAS_BUG_ON() from mas_topiary_range()lib/maple_tree.c+2 -10 repliesApplied
13/35maple_tree: Use MAS_WR_BUG_ON() in mas_store_prealloc()lib/maple_tree.c+1 -10 repliesApplied
14/35maple_tree: Use MAS_BUG_ON() prior to calling mas_meta_gap()lib/maple_tree.c+2 -20 repliesApplied
15/35maple_tree: Return error on mte_pivots() out of rangelib/maple_tree.c+14 -110 repliesApplied
16/35maple_tree: Make test code work without debug enabledlib/Kconfig.debug lib/test_maple_tree.c tools/testing/radix-tree/maple.c+31 -70 repliesApplied
17/35mm: Update validate_mm() to use vma iteratorinclude/linux/mmdebug.h mm/debug.c mm/internal.h +1 more+66 -610 repliesApplied
18/35mm: Update vma_iter_store() to use MAS_WARN_ON()mm/internal.h+10 -110 repliesApplied
19/35maple_tree: Add __init and __exit to test modulelib/test_maple_tree.c tools/testing/radix-tree/linux/init.h tools/testing/radix-tree/maple.c+155 -1510 repliesApplied
20/35maple_tree: Remove unnecessary check from mas_destroy()lib/maple_tree.c+1 -30 repliesApplied
21/35maple_tree: mas_start() reset depth on dead nodelib/maple_tree.c+1 -10 repliesApplied
22/35mm/mmap: Change do_vmi_align_munmap() for maple tree iterator changesmm/mmap.c+6 -10 repliesApplied
23/35maple_tree: Try harder to keep active node after mas_next()lib/maple_tree.c+47 -420 repliesApplied
24/35maple_tree: Try harder to keep active node with mas_prev()lib/maple_tree.c+83 -420 repliesApplied
25/35maple_tree: Revise limit checks in mas_empty_area{_rev}()lib/maple_tree.c lib/test_maple_tree.c+34 -140 repliesApplied
26/35maple_tree: Fix testing mas_empty_area()lib/test_maple_tree.c+1 -10 repliesApplied
27/35maple_tree: Introduce mas_next_slot() interfacelib/maple_tree.c+104 -1250 repliesApplied
28/35maple_tree: Add mas_next_range() and mas_find_range() interfacesinclude/linux/maple_tree.h lib/maple_tree.c+124 -510 repliesApplied
29/35maple_tree: Relocate mas_rewalk() and mas_rewalk_if_dead()lib/maple_tree.c+19 -190 repliesApplied
30/35maple_tree: Introduce mas_prev_slot() interfacelib/maple_tree.c+90 -1420 repliesApplied
31/35maple_tree: Add mas_prev_range() and mas_find_range_rev interfaceinclude/linux/maple_tree.h lib/maple_tree.c+124 -390 repliesApplied
32/35maple_tree: Clear up index and last setting in single entry treelib/maple_tree.c+11 -100 repliesApplied
33/35maple_tree: Update testing code for mas_{next,prev,walk}lib/test_maple_tree.c+633 -55 repliesApplied
34/35mm: Add vma_iter_{next,prev}_range() to vma iteratorinclude/linux/mm.h+13 -00 repliesApplied
35/35mm: Avoid rewalk in mmap_regionmm/mmap.c+3 -00 repliesApplied

Reviews trailers per patch

7 of 35 patches have a Reviewed-by or Acked-by.

PatchWei YangPeng ZhangSergey Senozhatsky
1/35R-b
2/35R-b
3/35R-b
4/35
5/35
6/35
7/35
8/35
9/35
10/35
11/35
12/35
13/35
14/35
15/35R-b
16/35
17/35
18/35R-b
19/35
20/35R-b
21/35R-b
22/35
23/35
24/35
25/35
26/35
27/35
28/35
29/35
30/35
31/35
32/35
33/35
34/35
35/35

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/35] Maple tree mas_{next,prev}_range() and cleanup

This patch set contains a number of clean ups to the code to make it more usable (next/prev range), the addition of debug output formatting, the addition of printing the maple state information in the WARN_ON/BUG_ON code.

There is also work done here to keep nodes active during iterations to reduce the necessity of re-walking the tree.

Finally, there is a new interface added to move to the next or previous range in the tree, even if it is empty.

The organisation of the patches is as follows:

0001-0004 - Small clean ups
0005-0018 - Additional debug options and WARN_ON/BUG_ON changes
0019 - Test module __init and __exit addition
0020-0021 - More functional clean ups
0022-0026 - Changes to keep nodes active
0027-0034 - Add new mas_{prev,next}_range()
0035 - Use new mas_{prev,next}_range() in mmap_region()

Changes since v3:
- Fixed whitespace issue in mas_find() - Thanks build bot
- Dropped mas_contiguous() until a user is implemented and it will be renamed - Thanks Andrew Morton
- Added missing comment to patch 34 "Add vma_iter_{next,prev}_range()"

v1: https://lore.kernel.org/linux-mm/[email protected]/
v2: https://lore.kernel.org/linux-mm/[email protected]/
v3: https://lore.kernel.org/linux-mm/[email protected]/

Liam R. Howlett (35):
maple_tree: Fix static analyser cppcheck issue
maple_tree: Clean up mas_parent_enum() and rename to mas_parent_type()
maple_tree: Avoid unnecessary ascending
maple_tree: Clean up mas_dfs_postorder()
maple_tree: Add format option to mt_dump()
maple_tree: Add debug BUG_ON and WARN_ON variants
maple_tree: Convert BUG_ON() to MT_BUG_ON()
maple_tree: Change RCU checks to WARN_ON() instead of BUG_ON()
maple_tree: Convert debug code to use MT_WARN_ON() and MAS_WARN_ON()
maple_tree: Use MAS_BUG_ON() when setting a leaf node as a parent
maple_tree: Use MAS_BUG_ON() in mas_set_height()
maple_tree: Use MAS_BUG_ON() from mas_topiary_range()
maple_tree: Use MAS_WR_BUG_ON() in mas_store_prealloc()
maple_tree: Use MAS_BUG_ON() prior to calling mas_meta_gap()
maple_tree: Return error on mte_pivots() out of range
maple_tree: Make test code work without debug enabled
mm: Update validate_mm() to use vma iterator
mm: Update vma_iter_store() to use MAS_WARN_ON()
maple_tree: Add __init and __exit to test module
maple_tree: Remove unnecessary check from mas_destroy()
maple_tree: mas_start() reset depth on dead node
mm/mmap: Change do_vmi_align_munmap() for maple tree iterator changes
maple_tree: Try harder to keep active node after mas_next()
maple_tree: Try harder to keep active node with mas_prev()
maple_tree: Revise limit checks in mas_empty_area{_rev}()
maple_tree: Fix testing mas_empty_area()
maple_tree: Introduce mas_next_slot() interface
maple_tree: Add mas_next_range() and mas_find_range() interfaces
maple_tree: Relocate mas_rewalk() and mas_rewalk_if_dead()
maple_tree: Introduce mas_prev_slot() interface
maple_tree: Add mas_prev_range() and mas_find_range_rev interface
maple_tree: Clear up index and last setting in single entry tree
maple_tree: Update testing code for mas_{next,prev,walk}
mm: Add vma_iter_{next,prev}_range() to vma iterator
mm: Avoid rewalk in mmap_region

 include/linux/maple_tree.h            |  118 ++-
 include/linux/mm.h                    |   13 +
 include/linux/mmdebug.h               |   14 +
 lib/Kconfig.debug                     |   10 +-
 lib/maple_tree.c                      | 1181 ++++++++++++++-----------
 lib/test_maple_tree.c                 |  863 +++++++++++++++---
 mm/debug.c                            |    9 +
 mm/internal.h                         |   20 +-
 mm/mmap.c                             |  111 ++-
 tools/testing/radix-tree/linux/init.h |    1 +
 tools/testing/radix-tree/maple.c      |  164 ++--
 11 files changed, 1748 insertions(+), 756 deletions(-)
Signature · 1 line
2.39.2