]> www.infradead.org Git - users/jedix/linux-maple.git/commit
maple_tree: break on convergence in mas_spanning_rebalance()
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Mon, 7 Apr 2025 18:41:00 +0000 (18:41 +0000)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 8 Apr 2025 20:01:43 +0000 (16:01 -0400)
commit95cf6f54e05f7ff386e14816d413339bd0301975
treed6705cad7daa302cd3fc6573d461864ebaf30018
parent301c6c2690ef47bce41da27323fcbf340eb39888
maple_tree: break on convergence in mas_spanning_rebalance()

This allows support for using the vacant height to calculate the worst
case number of nodes needed for wr_rebalance operation.
mas_spanning_rebalance() was seen to perform unnecessary node allocations.
We can reduce allocations by breaking early during the rebalancing loop
once we realize that we have ascended to a common ancestor.

Suggested-by: Liam Howlett <liam.howlett@oracle.com>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
lib/maple_tree.c