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

Mike Rapoport
2022-06-26T14:05:36Z

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@163.com>

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

Thanks,
Mike.