Re: [PATCH v2] memblock: avoid some repeat when add new range

From: Mike Rapoport
Date: Sun Jun 26 2022 - 10:05:38 EST


On Wed, Jun 15, 2022 at 05:40:15PM +0800, Jinyu Tang wrote:
> The worst case is that the new memory range overlaps all existing
> regions,which need type->cnt + 1 free area of struct memblock_region.
> So if type->cnt + 1 + type->cnt is less than type->max,we can insert
> regions directly.And becase of merge operation in the end of function,
> tpye->cnt increase slowly for many cases.So this patch can avoid
> unnecessary repeat for many cases when add new memory range.
>
> Signed-off-by: Jinyu Tang <tjytimi@xxxxxxx>

Applied to memblock/for-kernelci with minor changes to comment and
changelog text.

Thanks,
Mike.