OSDN Git Service

maple_tree: add mas_wr_new_end() to calculate new_end accurately
authorPeng Zhang <zhangpeng.00@bytedance.com>
Wed, 24 May 2023 03:12:43 +0000 (11:12 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 9 Jun 2023 23:25:45 +0000 (16:25 -0700)
commitc6fc9e4a5c505228032fa645e32341d243d51959
treead6c6759495b740e1ad0685067d135a34bfc40cd
parent8c995a631474a85c656e9237f868e2ddf87910c0
maple_tree: add mas_wr_new_end() to calculate new_end accurately

The previous new_end calculation is inaccurate, because it assumes that
two new pivots must be added (this is inaccurate), and sometimes it will
miss the fast path and enter the slow path.  Add mas_wr_new_end() to
accurately calculate new_end to make the conditions for entering the fast
path more accurate.

Link: https://lkml.kernel.org/r/20230524031247.65949-7-zhangpeng.00@bytedance.com
Signed-off-by: Peng Zhang <zhangpeng.00@bytedance.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/maple_tree.c