mem-offline: increment the NR_ISOLATED_ANON stat properly

Increment NR_ISOLATED_ANON when isolate a page so that the same is
decremented when the page migration is successful or when adding pages
back to the lru.

Change-Id: I6879c0029342560496b79d649a77283c767ab08e
Fixes: aa3fa08df4 ("mem-offline: improve the effective utilization of movable zone")
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
Charan Teja Reddy 2020-11-20 20:59:38 +05:30 • committed by Gerrit - the friendly Code Review server
commit 3efde2bdaa

View file

@ -8,6 +8,7 @@
#include <linux/memblock.h>
#include <linux/mmu_context.h>
#include <linux/mmzone.h>
#include <linux/mm_inline.h>
#include <linux/ktime.h>
#include <linux/of.h>
#include <linux/proc_fs.h>
@ -538,6 +539,8 @@ static unsigned long get_anon_movable_pages(
ret = isolate_lru_page(page);
if (!ret) {
list_add_tail(&page->lru, list);
inc_node_page_state(page, NR_ISOLATED_ANON +
page_is_file_cache(page));
++fc->nr_migrate_pages;
}