ANDROID: implement wrapper for reverse migration

Reverse migration is used to do the balancing the occupancy of memory
zones in a node in the system whose imabalance may be caused by
migration of pages to other zones by an operation, eg: hotremove and
then hotadding the same memory. In this case there is a lot of free
memory in newly hotadd memory which can be filled up by the previous
migrated pages(as part of offline/hotremove) thus may free up some
pressure in other zones of the node.

Upstream discussion: https://lore.kernel.org/patchwork/cover/1382106/

Change-Id: Ib3137dab0db66ecf6858c4077dcadb9dfd0c6b1c
Bug: 175403896
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
Charan Teja Reddy
2021-02-16 13:59:45 +05:30
committed by Suren Baghdasaryan
parent ea527a52d1
commit 8cd9aa93b7
5 changed files with 52 additions and 0 deletions

View File

@@ -537,6 +537,24 @@ unsigned long get_pfnblock_flags_mask(struct page *page, unsigned long pfn,
{
return __get_pfnblock_flags_mask(page, pfn, mask);
}
EXPORT_SYMBOL_GPL(get_pfnblock_flags_mask);
int isolate_anon_lru_page(struct page *page)
{
int ret;
if (!PageLRU(page) || !PageAnon(page))
return -EINVAL;
if (!get_page_unless_zero(page))
return -EINVAL;
ret = isolate_lru_page(page);
put_page(page);
return ret;
}
EXPORT_SYMBOL_GPL(isolate_anon_lru_page);
static __always_inline int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
{