memblock tests: add memblock_reserve_many_may_conflict_check()

This may trigger the case fixed by commit 48c3b583bb ("mm/memblock:
fix overlapping allocation when doubling reserved array").

This is done by adding the 129th reserve region into memblock.memory. If
memblock_double_array() use this reserve region as new array, it fails.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Link: https://lore.kernel.org/r/20240507075833.6346-3-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
This commit is contained in:
Wei Yang
2024-05-07 07:58:28 +00:00
committed by Mike Rapoport (IBM)
parent 3d31651937
commit f6df89c358
3 changed files with 154 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ void reset_memblock_attributes(void)
static inline void fill_memblock(void)
{
memset(memory_block.base, 1, MEM_SIZE);
memset(memory_block.base, 1, PHYS_MEM_SIZE);
}
void setup_memblock(void)
@@ -103,7 +103,7 @@ void setup_numa_memblock(const unsigned int node_fracs[])
void dummy_physical_memory_init(void)
{
memory_block.base = malloc(MEM_SIZE);
memory_block.base = malloc(PHYS_MEM_SIZE);
assert(memory_block.base);
fill_memblock();
}