Re: [v2 PATCH] mm: vmscan: correct nr_reclaimed for THP

From: Yang Shi
Date: Tue May 21 2019 - 02:56:49 EST



[ check_move_unevictable_pages() seems weird. It gets a pagevec from
find_get_entries(), which, if I understand the THP page cache code
correctly, might contain the same compound page over and over. It'll
be !unevictable after the first iteration, so will only run once. So
it produces incorrect numbers now, but it is probably best to ignore
it until we figure out THP cache. Maybe add an XXX comment. ]

The commit 5fd4ca2d84b2 ("mm: page cache: store only head pages in i_pages") changed how THP is stored in page cache, but find_get_entries() would return base page by calling find_subpage(), so check_move_unevictable_pages() should just returns the number of base pages.