Re: [PATCH 4/5] mm: consider per-zone inactive ratio to deactivate

From: Johannes Weiner
Date: Thu Jul 21 2016 - 11:55:49 EST


On Thu, Jul 21, 2016 at 03:11:00PM +0100, Mel Gorman wrote:
> @@ -1981,6 +1982,32 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file)
> inactive = lruvec_lru_size(lruvec, file * LRU_FILE);
> active = lruvec_lru_size(lruvec, file * LRU_FILE + LRU_ACTIVE);
>
> + /*
> + * For global reclaim on zone-constrained allocations, it is necessary
> + * to check if rotations are required for lowmem to be reclaimed. This

s/rotation/deactivation/

> + * calculates the inactive/active pages available in eligible zones.
> + */
> + if (global_reclaim(sc)) {
> + struct pglist_data *pgdat = lruvec_pgdat(lruvec);
> + int zid;
> +
> + for (zid = sc->reclaim_idx + 1; zid < MAX_NR_ZONES; zid++) {

The emphasis on global vs. memcg reclaim is somewhat strange, because
this is only about excluding pages from the balancing math that will
be skipped. Memcg reclaim is never zone-restricted, but if it were, it
would make sense to exclude the skipped pages there as well.

Indeed, for memcg reclaim sc->reclaim_idx+1 is always MAX_NR_ZONES,
and so the for loop alone will do the right thing.

Can you please drop the global_reclaim() branch, the sc function
parameter, and the "global reclaim" from the comment?

Thanks