Commit 7b09fa7e authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Andrew Morton

mm/memory_hotplug: drop memblock_phys_free() call in try_remove_memory()

The call for memblock_phys_free() in try_remove_memory() does not balance
any call to memblock_alloc() (or memblock_reserve() for that matter).

There are no memblock_reserve() calls in mm/memory_hotplug.c, no memblock
allocations possible after mm_core_init(), and even if memblock_add_node()
called from add_memory_resource() would need to allocate memory, that
memory would ba allocated from slab.

The patch f9126ab9 ("memory-hotplug: fix wrong edge when hot add a new
node") that introduced that call to memblock_free() does not provide
adequate description why that was required and tinkering with memblock in
the context of memory hotplug on x86 seems bogus because x86 never kept
memblock after boot anyway.

Drop memblock_phys_free() call in try_remove_memory().

[rppt@kernel.org: rewrite the commit message]
Link: https://lkml.kernel.org/r/20240605082049.973242-1-rppt@kernel.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
Acked-by: default avatarDavid Hildenbrand <david@redhat.com>
Acked-by: default avatarOscar Salvador <osalvador@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 656fe3ee
...@@ -2282,10 +2282,8 @@ static int __ref try_remove_memory(u64 start, u64 size) ...@@ -2282,10 +2282,8 @@ static int __ref try_remove_memory(u64 start, u64 size)
remove_memory_blocks_and_altmaps(start, size); remove_memory_blocks_and_altmaps(start, size);
} }
if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK))
memblock_phys_free(start, size);
memblock_remove(start, size); memblock_remove(start, size);
}
release_mem_region_adjustable(start, size); release_mem_region_adjustable(start, size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment