Re: [PATCH REBASED 1/4] mm: Move recent_rotated pages calculation to shrink_inactive_list()

From: Johannes Weiner
Date: Tue May 28 2019 - 11:54:59 EST


On Mon, Mar 18, 2019 at 12:27:59PM +0300, Kirill Tkhai wrote:
> @@ -1945,6 +1942,8 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
> count_memcg_events(lruvec_memcg(lruvec), PGSTEAL_DIRECT,
> nr_reclaimed);
> }
> + reclaim_stat->recent_rotated[0] = stat.nr_activate[0];
> + reclaim_stat->recent_rotated[1] = stat.nr_activate[1];

Surely this should be +=, right?

Otherwise we maintain essentially no history of page rotations and
that wreaks havoc on the page cache vs. swapping reclaim balance.