diff options
| author | Mark Brown <broonie@kernel.org> | 2026-05-29 17:41:23 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-05-29 17:41:23 +0100 |
| commit | c2e4203073dab09eccb800d48c831d1ca55b346f (patch) | |
| tree | 2b5ad7ed38c7dc540567c80bc36c976a81b4778d /mm | |
| parent | 2732123900c0f6361a057e854f6ec2a3200776f0 (diff) | |
| parent | 8623045aa5d24de177c23c86f01d1249ecf2dc10 (diff) | |
| download | linux-next-history-c2e4203073dab09eccb800d48c831d1ca55b346f.tar.gz | |
Merge branch 'fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock.git
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/memblock.c | 6 | ||||
| -rw-r--r-- | mm/numa_emulation.c | 17 |
2 files changed, 17 insertions, 6 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index a6a1c91e276d3..ccd43f3abb82d 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -989,13 +989,15 @@ void __init_memblock memblock_free(void *ptr, size_t size) int __init_memblock memblock_phys_free(phys_addr_t base, phys_addr_t size) { phys_addr_t end = base + size - 1; - int ret; + int ret = 0; memblock_dbg("%s: [%pa-%pa] %pS\n", __func__, &base, &end, (void *)_RET_IP_); kmemleak_free_part_phys(base, size); - ret = memblock_remove_range(&memblock.reserved, base, size); + + if (!slab_is_available() || IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) + ret = memblock_remove_range(&memblock.reserved, base, size); if (slab_is_available()) __free_reserved_area(base, base + size, -1); diff --git a/mm/numa_emulation.c b/mm/numa_emulation.c index 703c8fa050480..55f26b22bb0be 100644 --- a/mm/numa_emulation.c +++ b/mm/numa_emulation.c @@ -214,7 +214,7 @@ static u64 uniform_size(u64 max_addr, u64 base, u64 hole, int nr_nodes) * Sets up fake nodes of `size' interleaved over physical nodes ranging from * `addr' to `max_addr'. * - * Returns zero on success or negative on error. + * Returns node ID of the next node on success or negative error code. */ static int __init split_nodes_size_interleave_uniform(struct numa_meminfo *ei, struct numa_meminfo *pi, @@ -398,7 +398,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) */ if (strchr(emu_cmdline, 'U')) { unsigned long n; - int nid = 0; + int nid = 0, nr_created; n = simple_strtoul(emu_cmdline, &emu_cmdline, 0); ret = -1; @@ -416,9 +416,18 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) n, &pi.blk[0], nid); if (ret < 0) break; - if (ret < n) { + + /* + * If no memory was found for this physical node, + * skip the under-allocation check. + */ + if (ret == nid) + continue; + + nr_created = ret - nid; + if (nr_created < n) { pr_info("%s: phys: %d only got %d of %ld nodes, failing\n", - __func__, i, ret, n); + __func__, i, nr_created, n); ret = -1; break; } |
