Re: [PATCH 06/27] mm, vmscan: Make kswapd reclaim in terms of nodes

Mel Gorman
2016-06-23T11:31:58Z

On Wed, Jun 22, 2016 at 04:42:06PM +0800, Hillf Danton wrote:
> > /*
> > - * If a zone reaches its high watermark, consider it to be no longer
> > - * congested. It's possible there are dirty pages backed by congested
> > - * BDIs but as pressure is relieved, speculatively avoid congestion
> > - * waits.
> > + * Fragmentation may mean that the system cannot be rebalanced for
> > + * high-order allocations. If twice the allocation size has been
> > + * reclaimed then recheck watermarks only at order-0 to prevent
> > + * excessive reclaim. Assume that a process requested a high-order
> > + * can direct reclaim/compact.
> > */
> > - if (pgdat_reclaimable(zone->zone_pgdat) &&
> > - zone_balanced(zone, sc->order, false, 0, classzone_idx)) {
> > - clear_bit(PGDAT_CONGESTED, &pgdat->flags);
> > - clear_bit(PGDAT_DIRTY, &pgdat->flags);
> > - }
> > + if (sc->order && sc->nr_reclaimed >= 2UL << sc->order)
> > + sc->order = 0;
> >
>
> Reclaim order is changed here.
> Btw, I find no such change in current code.
>

It is reintroducing a check removed by commit accf62422b3a ("mm, kswapd: replace
kswapd compaction with waking up kcompactd"). That patch had kswapd
always check at order-0 once kswapd is awake in pgdat_balanced but would
still take at least one pass through reclaiming so kcompactd potentially
makes progress.

This patch removes pgdat_balanced entirely and zone_balanced() checks the
order it is asked like it used to. Hence, it is necessary to reset sc->order
once progress is made or kswapd potentially stays awake reclaiming pages
until a high-order page is freed.

--
Mel Gorman
SUSE Labs