ANDROID: mm/memory_hotplug: Relax remove_memory_subsection error checking
A memory section may contain a mix of memory present at bootup, and
memory added dynamically via add_memory_subsection(). Fix
remove_memory_subsection to not return an error for this situation.
Bug: 190151165i
Fixes: 417ac617ea ("ANDROID: mm/memory_hotplug: implement {add/remove}_memory_subsection")
Change-Id: I20314fe136d6e5b56a9275be7e2d130d18bd79a5
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
This commit is contained in:
parent
d98a1df787
commit
813d6c9121
1 changed files with 0 additions and 25 deletions
|
|
@ -1834,22 +1834,6 @@ int remove_memory(int nid, u64 start, u64 size)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(remove_memory);
|
||||
|
||||
static bool __check_sections_offline(unsigned long start_pfn,
|
||||
unsigned long nr_pages)
|
||||
{
|
||||
const unsigned long end_pfn = start_pfn + nr_pages;
|
||||
unsigned long pfn, sec_nr;
|
||||
|
||||
for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
|
||||
sec_nr = pfn_to_section_nr(pfn);
|
||||
|
||||
if (!valid_section_nr(sec_nr) || online_section_nr(sec_nr))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int remove_memory_subsection(int nid, u64 start, u64 size)
|
||||
{
|
||||
if (size == memory_block_size_bytes())
|
||||
|
|
@ -1863,15 +1847,6 @@ int remove_memory_subsection(int nid, u64 start, u64 size)
|
|||
}
|
||||
|
||||
mem_hotplug_begin();
|
||||
|
||||
/* we cannot remove subsections that are invalid or online */
|
||||
if(!__check_sections_offline(PHYS_PFN(start), size >> PAGE_SHIFT)) {
|
||||
pr_err("%s: [%llx, %llx) sections are not offlined\n",
|
||||
__func__, start, start + size);
|
||||
mem_hotplug_done();
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
arch_remove_memory(nid, start, size, NULL);
|
||||
|
||||
if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue