linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maple_tree: remove mast_overflow.
@ 2023-11-11 11:04 Levi Yun
  2023-11-12 15:29 ` Liam R. Howlett
  0 siblings, 1 reply; 2+ messages in thread
From: Levi Yun @ 2023-11-11 11:04 UTC (permalink / raw)
  To: Liam.Howlett; +Cc: maple-tree, linux-mm, linux-kernel, Levi Yun

mast_overflow is used only in mas_spanning_rebalance.
But when mast_sufficient is false, mast_overflow always returns false,
and when mast_suffictent is true, it never reaches to mast_overflow in
mas_spanning_rebalance.

Therefore, mast_overflow is dead code in mas_spanning_rebalance.
And there is no other usage of mast_overflow execpt
mas_spanning_rebalance, Remove mast_overflow.

Signed-off-by: Levi Yun <ppbuk5246@gmail.com>
---
 lib/maple_tree.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index bb24d84a4922..1e591e71621e 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -2767,19 +2767,6 @@ static inline bool mast_sufficient(struct maple_subtree_state *mast)
 	return false;
 }
 
-/*
- * mast_overflow: Check if there is too much data in the subtree state for a
- * single node.
- * @mast: The maple subtree state
- */
-static inline bool mast_overflow(struct maple_subtree_state *mast)
-{
-	if (mast->bn->b_end >= mt_slot_count(mast->orig_l->node))
-		return true;
-
-	return false;
-}
-
 static inline void *mtree_range_walk(struct ma_state *mas)
 {
 	unsigned long *pivots;
@@ -2934,9 +2921,6 @@ static int mas_spanning_rebalance(struct ma_state *mas,
 		if (mast_sufficient(mast))
 			continue;
 
-		if (mast_overflow(mast))
-			continue;
-
 		/* May be a new root stored in mast->bn */
 		if (mas_is_root_limits(mast->orig_l))
 			break;
-- 
2.41.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-12 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-11 11:04 [PATCH] maple_tree: remove mast_overflow Levi Yun
2023-11-12 15:29 ` Liam R. Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox