]> 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>
Thu, 27 Feb 2025 20:48:21 +0000 (20:48 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Feb 2025 01:00:39 +0000 (17:00 -0800)
commit0bd7eff46a19403e13cd6aeca39f58947a18b18d
tree1eabb9bf5e9940faa80c402ae9d56604af2ccfed
parent0e14180735317cf3f69c0145325fee9a3e0eac1c
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.

Link: https://lkml.kernel.org/r/20250227204823.758784-5-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
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: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c