[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250211071850.330632-1-richard120310@gmail.com>
Date: Tue, 11 Feb 2025 15:18:50 +0800
From: I Hsin Cheng <richard120310@...il.com>
To: Liam.Howlett@...cle.com
Cc: akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org,
maple-tree@...ts.infradead.org,
linux-mm@...ck.org,
jserv@...s.ncku.edu.tw,
skhan@...uxfoundation.org,
I Hsin Cheng <richard120310@...il.com>
Subject: [PATCH] maple_tree: Use ma_dead_node() in mte_dead_node()
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@...il.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
Powered by blists - more mailing lists