ANDROID: mm/memory_hotplug: Don't special case memory_block_size_bytes

If add_memory_subsection() is called with a size of
memory_block_size_bytes, it calls into add_memory(), which declares
the region as system ram, and adds it to the buddy allocator. This
is inconsistent with the behavior of add_memory_subsection() for
other sizes, for which it does not add the memory to buddy and
instead reserves it for the caller's private use.

Bug: 210008865
Fixes: 417ac617ea ("ANDROID: mm/memory_hotplug: implement {add/remove}_memory_subsection")
Change-Id: Iefb69b0b4e96af670d0e65c325a9538d14b460e3
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
This commit is contained in:
Patrick Daly
2021-12-08 21:29:03 -08:00
committed by Todd Kjos
parent 8b7ffd60a5
commit f37b6d79f8

View File

@@ -1136,9 +1136,6 @@ int add_memory_subsection(int nid, u64 start, u64 size)
struct resource *res;
int ret;
if (size == memory_block_size_bytes())
return add_memory(nid, start, size, MHP_NONE);
if (!IS_ALIGNED(start, SUBSECTION_SIZE) ||
!IS_ALIGNED(size, SUBSECTION_SIZE)) {
pr_err("%s: start 0x%llx size 0x%llx not aligned to subsection size\n",
@@ -1837,9 +1834,6 @@ EXPORT_SYMBOL_GPL(remove_memory);
int remove_memory_subsection(int nid, u64 start, u64 size)
{
if (size == memory_block_size_bytes())
return remove_memory(nid, start, size);
if (!IS_ALIGNED(start, SUBSECTION_SIZE) ||
!IS_ALIGNED(size, SUBSECTION_SIZE)) {
pr_err("%s: start 0x%llx size 0x%llx not aligned to subsection size\n",