The patch titled Subject: maple_tree: set the node limit when creating a new root node has been added to the -mm mm-hotfixes-unstable branch. Its filename is maple_tree-set-the-node-limit-when-creating-a-new-root-node.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-set-the-node-limit-when-creating-a-new-root-node.patch This patch will later appear in the mm-hotfixes-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> Subject: maple_tree: set the node limit when creating a new root node Date: Tue, 11 Jul 2023 11:54:37 +0800 Set the node limit of the root node so that the last pivot of all nodes is the node limit (if the node is not full). This patch also fixes a bug in mas_rev_awalk(). Effectively, always setting a maximum makes mas_logical_pivot() behave as mas_safe_pivot(). Without this fix, it is possible that very small tasks would fail to find the correct gap. Although this has not been observed with real tasks, it has been reported to happen in m68k nommu running the maple tree tests. Link: https://lkml.kernel.org/r/20230711035444.526-1-zhangpeng.00@xxxxxxxxxxxxx Link: https://lore.kernel.org/linux-mm/CAMuHMdV4T53fOw7VPoBgPR7fP6RYqf=CBhD_y_vOg53zZX_DnA@xxxxxxxxxxxxxx/ Link: https://lkml.kernel.org/r/20230711035444.526-2-zhangpeng.00@xxxxxxxxxxxxx Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Peng Zhang <zhangpeng.00@xxxxxxxxxxxxx> Reviewed-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> Tested-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/maple_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/lib/maple_tree.c~maple_tree-set-the-node-limit-when-creating-a-new-root-node +++ a/lib/maple_tree.c @@ -3692,7 +3692,8 @@ static inline int mas_root_expand(struct mas->offset = slot; pivots[slot] = mas->last; if (mas->last != ULONG_MAX) - slot++; + pivots[++slot] = ULONG_MAX; + mas->depth = 1; mas_set_height(mas); ma_set_meta(node, maple_leaf_64, 0, slot); _ Patches currently in -mm which might be from zhangpeng.00@xxxxxxxxxxxxx are maple_tree-set-the-node-limit-when-creating-a-new-root-node.patch maple_tree-add-test-for-mas_wr_modify-fast-path.patch maple_tree-add-test-for-expanding-range-in-rcu-mode.patch maple_tree-optimize-mas_wr_append-also-improve-duplicating-vmas.patch maple_tree-add-a-fast-path-case-in-mas_wr_slot_store.patch maple_tree-dont-use-maple_arange64_meta_max-to-indicate-no-gap.patch maple_tree-make-mas_validate_gaps-to-check-metadata.patch maple_tree-fix-mas_validate_child_slot-to-check-last-missed-slot.patch maple_tree-make-mas_validate_limits-check-root-node-and-node-limit.patch maple_tree-update-mt_validate.patch maple_tree-replace-mas_logical_pivot-with-mas_safe_pivot.patch maple_tree-drop-mas_first_entry.patch