summaryrefslogtreecommitdiff
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorArun KS <arunks@codeaurora.org>2017-09-15 13:52:00 +0530
committerArun KS <arunks@codeaurora.org>2017-11-22 17:12:55 +0530
commitea4e70e7d64e9598b4ddf6acb28363acbb8e6add (patch)
treecf0a8fa1fecdf038be36624240e30521486096f9 /mm/memory_hotplug.c
parent2247011a9c93311ec6f73190e2080dffc55526bc (diff)
arm64: Honor limits set by bootloader
Introduce a varible to save bootloader enforced memory limits and restricts adding beyond this boundary during a memory hotplug. Change-Id: I28c100644b7287ec4625c4c018b5fffc865e2e72 Signed-off-by: Arun KS <arunks@codeaurora.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 2ad8a8888032..81957b076d66 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -45,7 +45,7 @@
* and restore_online_page_callback() for generic callback restore.
*/
-static void generic_online_page(struct page *page);
+static int generic_online_page(struct page *page);
static online_page_callback_t online_page_callback = generic_online_page;
static DEFINE_MUTEX(online_page_callback_lock);
@@ -857,11 +857,12 @@ void __online_page_free(struct page *page)
}
EXPORT_SYMBOL_GPL(__online_page_free);
-static void generic_online_page(struct page *page)
+static int generic_online_page(struct page *page)
{
__online_page_set_limits(page);
__online_page_increment_counters(page);
__online_page_free(page);
+ return 0;
}
static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
@@ -870,11 +871,13 @@ static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages,
unsigned long i;
unsigned long onlined_pages = *(unsigned long *)arg;
struct page *page;
+ int ret;
if (PageReserved(pfn_to_page(start_pfn)))
for (i = 0; i < nr_pages; i++) {
page = pfn_to_page(start_pfn + i);
- (*online_page_callback)(page);
- onlined_pages++;
+ ret = (*online_page_callback)(page);
+ if (!ret)
+ onlined_pages++;
}
*(unsigned long *)arg = onlined_pages;
return 0;