diff options
author | Jinyu Tang <tjytimi@163.com> | 2022-06-15 17:40:15 +0800 |
---|---|---|
committer | Mike Rapoport <rppt@linux.ibm.com> | 2022-06-30 11:55:00 +0300 |
commit | 28e1a8f4b0ff1eafc320ec733b9c61ee7eb633ea (patch) | |
tree | c42f476f4b01620d39555d3bb504bedf4750d1b2 /mm/kasan | |
parent | 03c765b0e3b4cb5063276b086c76f7a612856a9a (diff) | |
download | linux-stable-28e1a8f4b0ff1eafc320ec733b9c61ee7eb633ea.tar.gz linux-stable-28e1a8f4b0ff1eafc320ec733b9c61ee7eb633ea.tar.bz2 linux-stable-28e1a8f4b0ff1eafc320ec733b9c61ee7eb633ea.zip |
memblock: avoid some repeat when add new range
The worst case is that the new memory range overlaps all existing
regions, which requires type->cnt + 1 empty struct memblock_region slots in
the type->regions array.
So if type->cnt + 1 + type->cnt is less than type->max, we can insert
regions directly rather than calculate the needed amount before the
insertion.
And becase of merge operation in the end of function, tpye->cnt will
increase slowly for many cases.
This change allows to avoid unnecessary repeat of memblock ranges traversal
for many cases when adding new memory range.
Signed-off-by: Jinyu Tang <tjytimi@163.com>
[rppt: massaged comment and changelog text]
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Diffstat (limited to 'mm/kasan')
0 files changed, 0 insertions, 0 deletions