Skip to content

Commit ac8f05d

Browse files
Chanho Mintorvalds
authored andcommitted
mm/zsmalloc.c: fix the migrated zspage statistics.
When zspage is migrated to the other zone, the zone page state should be updated as well, otherwise the NR_ZSPAGE for each zone shows wrong counts including proc/zoneinfo in practice. Link: http://lkml.kernel.org/r/[email protected] Fixes: 91537fe ("mm: add NR_ZSMALLOC to vmstat") Signed-off-by: Chanho Min <[email protected]> Signed-off-by: Jinsuk Choi <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Acked-by: Minchan Kim <[email protected]> Cc: <[email protected]> [4.9+] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent feee6b2 commit ac8f05d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mm/zsmalloc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,6 +2069,11 @@ static int zs_page_migrate(struct address_space *mapping, struct page *newpage,
20692069
zs_pool_dec_isolated(pool);
20702070
}
20712071

2072+
if (page_zone(newpage) != page_zone(page)) {
2073+
dec_zone_page_state(page, NR_ZSPAGES);
2074+
inc_zone_page_state(newpage, NR_ZSPAGES);
2075+
}
2076+
20722077
reset_page(page);
20732078
put_page(page);
20742079
page = newpage;

0 commit comments

Comments
 (0)