diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-06-05 11:20:49 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-07-04 05:30:04 +0300 |
commit | 7b09fa7ea4ee91ec2ad8ea6e9560f63901f2b76a (patch) | |
tree | c6816c70280cddd64f2c4cfde0f49ce6140db2a7 /mm/memory_hotplug.c | |
parent | 656fe3ee455e8d8dfa1c18292c508da26b29a39c (diff) | |
download | linux-7b09fa7ea4ee91ec2ad8ea6e9560f63901f2b76a.tar.xz |
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 f9126ab9241f ("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.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r-- | mm/memory_hotplug.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9c36eb3bbd3b..171ad975c7cf 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -2282,10 +2282,8 @@ static int __ref try_remove_memory(u64 start, u64 size) remove_memory_blocks_and_altmaps(start, size); } - if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { - memblock_phys_free(start, size); + if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) memblock_remove(start, size); - } release_mem_region_adjustable(start, size); |