linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maple_tree: Use ma_dead_node() in mte_dead_node()
@ 2025-02-11  7:18 I Hsin Cheng
  2025-02-11 15:34 ` Liam R. Howlett
  0 siblings, 1 reply; 2+ messages in thread
From: I Hsin Cheng @ 2025-02-11  7:18 UTC (permalink / raw)
  To: Liam.Howlett
  Cc: akpm, linux-kernel, maple-tree, linux-mm, jserv, skhan, I Hsin Cheng

Utilize ma_dead_node() in mte_dead_node(). It can prevent decoding the
maple enode for a second time. Use the "node" to find parent for
comparison.

Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
---
 lib/maple_tree.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/maple_tree.c b/lib/maple_tree.c
index f7153ade1be5..362f85c62678 100644
--- a/lib/maple_tree.c
+++ b/lib/maple_tree.c
@@ -584,13 +584,10 @@ static __always_inline bool ma_dead_node(const struct maple_node *node)
  */
 static __always_inline bool mte_dead_node(const struct maple_enode *enode)
 {
-	struct maple_node *parent, *node;
+	struct maple_node *node;
 
 	node = mte_to_node(enode);
-	/* Do not reorder reads from the node prior to the parent check */
-	smp_rmb();
-	parent = mte_parent(enode);
-	return (parent == node);
+	return ma_dead_node(node);
 }
 
 /*
-- 
2.43.0



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

end of thread, other threads:[~2025-02-11 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-11  7:18 [PATCH] maple_tree: Use ma_dead_node() in mte_dead_node() I Hsin Cheng
2025-02-11 15:34 ` 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