Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Link: https://lkml.kernel.org/r/20250211071850.330632-1-richard120310@gmail.com
Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Cc: Shuah khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

I Hsin Cheng and committed by
Andrew Morton
6fbea852 4bc2e699

+2 -5
+2 -5
lib/maple_tree.c
··· 584 584 */ 585 585 static __always_inline bool mte_dead_node(const struct maple_enode *enode) 586 586 { 587 - struct maple_node *parent, *node; 587 + struct maple_node *node; 588 588 589 589 node = mte_to_node(enode); 590 - /* Do not reorder reads from the node prior to the parent check */ 591 - smp_rmb(); 592 - parent = mte_parent(enode); 593 - return (parent == node); 590 + return ma_dead_node(node); 594 591 } 595 592 596 593 /*