The patch titled Subject: maple_tree: remove conditionals to detect wr_node_store has been added to the -mm mm-unstable branch. Its filename is maple_tree-remove-conditionals-to-detect-wr_node_store.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple_tree-remove-conditionals-to-detect-wr_node_store.patch This patch will later appear in the mm-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: Sidhartha <sidhartha.kumar@xxxxxxxxxx> Subject: maple_tree: remove conditionals to detect wr_node_store Date: Wed, 9 Oct 2024 11:20:07 -0400 In mas_wr_store_type(), we check if new_end < mt_slots[wr_mas->type]. If this check fails, we know that ,after this, new_end is >= mt_min_slots. Checking this again when we detect a wr_node_store later in the function is reduntant. Because this check is part of an OR statement, the statement will always evaluate to true, therefore we can just get rid of it. Link: https://lkml.kernel.org/r/20241009152007.2096-1-sidhartha.kumar@xxxxxxxxxx Signed-off-by: Sidhartha Kumar <sidhartha.kumar@xxxxxxxxxx> Suggested-by; Wei Yang <richard.weiyang@xxxxxxxxx> Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/maple_tree.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) --- a/lib/maple_tree.c~maple_tree-remove-conditionals-to-detect-wr_node_store +++ a/lib/maple_tree.c @@ -4252,14 +4252,7 @@ static inline void mas_wr_store_type(str return; } - if (mte_is_root(mas->node) || (new_end >= mt_min_slots[wr_mas->type]) || - (mas->mas_flags & MA_STATE_BULK)) { - mas->store_type = wr_node_store; - return; - } - - mas->store_type = wr_invalid; - MAS_WARN_ON(mas, 1); + mas->store_type = wr_node_store; } /** _ Patches currently in -mm which might be from sidhartha.kumar@xxxxxxxxxx are maple_tree-remove-conditionals-to-detect-wr_node_store.patch