cleanup mast_split_data()
Subsystems (3)
cover cleanup mast_split_data()
There are two possible redundant code:
1. the left subtree's mas is set in mab_mas_cp()
2. the right subtree's pivot 0 would be set again in mab_mas_cp()
We can remove them.
Wei Yang (2):
maple_tree: the new max of left side subtree has been set
maple_tree: not necessary to set pivot 0 before mab_mas_cp()
lib/maple_tree.c | 2 -- 1 file changed, 2 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/2 maple_tree: the new max of left side subtree has been set
The max value has been updated in mab_mas_cp() on copying the left part.
Not necessary to update it again.
--- lib/maple_tree.c | 1 - 1 file changed, 1 deletion(-)
lib/maple_tree.c +0 -1
@@ -3177,7 +3177,6 @@ static inline void mast_split_data(struct maple_subtree_state *mast,mte_set_pivot (mast->r->node,0 , mast->r->max);mab_mas_cp (mast->bn, split +1 , mast->bn->b_end, mast->r, false); mast->l->offset =mte_parent_slot (mas->node); - mast->l->max = mast->bn->pivot[split]; mast->r->min = mast->l->max +1 ;if (mte_is_leaf (mas->node))return ;
Signature · 1 line
2.34.1
Quoted 6 lines · Wei Yang
There are two possible redundant code:
1. the left subtree's mas is set in
mab_mas_cp()
2. the right subtree's pivot 0 would be set again inmab_mas_cp()We can remove them.
Is there any measurable difference with these changes?
Quoted 11 lines
Wei Yang (2):
maple_tree: the new max of left side subtree has been set
maple_tree: not necessary to set pivot 0 beforemab_mas_cp()lib/maple_tree.c | 2 -- 1 file changed, 2 deletions(-)Signature · 1 line
2.34.1
Quoted 10 lines · Liam R. Howlett
Quoted 6 lines · Wei Yang
There are two possible redundant code:
1. the left subtree's mas is set in
mab_mas_cp()
2. the right subtree's pivot 0 would be set again inmab_mas_cp()We can remove them.
Is there any measurable difference with these changes?
I guess no.
Signature · 2 lines
Wei Yang Help you, Help me
PATCH 2/2 maple_tree: not necessary to set pivot 0 before mab_mas_cp()
In reply to Wei Yangmab_mas_cp() at least copy one pivot, which is pivot 0. This means the pivot 0 set by mte_set_pivot() will be overwritten.
Just remote this redundant code.
--- lib/maple_tree.c | 1 - 1 file changed, 1 deletion(-)
lib/maple_tree.c +0 -1
@@ -3174,7 +3174,6 @@ static inline void mast_split_data(struct maple_subtree_state *mast,unsigned char p_slot;mab_mas_cp (mast->bn,0 , split, mast->l, true); -mte_set_pivot (mast->r->node,0 , mast->r->max);mab_mas_cp (mast->bn, split +1 , mast->bn->b_end, mast->r, false); mast->l->offset =mte_parent_slot (mas->node); mast->r->min = mast->l->max +1 ;
Signature · 1 line
2.34.1