Mapped file accounting depends on the the page being charged already, or it won't get accounted properly, and the mapped file counter will underflow during unmap later on. Move mem_cgroup_migrate() before remove_migration_ptes(). Signed-off-by: Johannes Weiner <hannes@xxxxxxxxxxx> --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index ab43fbfff8ba..7f5a42403fae 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -781,11 +781,11 @@ static int move_to_new_page(struct page *newpage, struct page *page, if (!PageAnon(newpage)) newpage->mapping = NULL; } else { + mem_cgroup_migrate(page, newpage, false); if (remap_swapcache) remove_migration_ptes(page, newpage); if (!PageAnon(page)) page->mapping = NULL; - mem_cgroup_migrate(page, newpage, false); } unlock_page(newpage); -- 2.0.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>