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: 417ac617ea5e ("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 Suren Baghdasaryan
parent 6b6c4a7373
commit 49ad57e915
1 changed files with 0 additions and 6 deletions

View File

@ -1496,9 +1496,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",
@ -2295,9 +2292,6 @@ EXPORT_SYMBOL_GPL(remove_memory);
int remove_memory_subsection(u64 start, u64 size)
{
if (size == memory_block_size_bytes())
return remove_memory(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",