Re: [RFC Patch] mm/vmscan.c: not inherit classzone_idx from previous reclaim

From: Matthew Wilcox
Date: Thu Feb 13 2020 - 21:48:19 EST


On Fri, Feb 14, 2020 at 10:05:15AM +0800, Wei Yang wrote:
> On Wed, Feb 12, 2020 at 07:43:33AM +0000, Mel Gorman wrote:
> >Broadly speaking it was driven by cases whereby kswapd either a) fell
> >asleep prematurely and there were many stalls in direct reclaim before
> >kswapd recovered, b) stalls in direct reclaim immediately after kswapd went
> >to sleep or c) kswapd reclaimed for lower zones and went to sleep while
> >parallel tasks were direct reclaiming in higher zones or higher orders.
>
> Thanks for your explanation. I am trying to understand the connection between
> those cases and the behavior of kswapd.
>
> In summary, all three cases are related to direct reclaim, while happens in
> three different timing of kswapd:

Reclaim performed by kswapd is the opposite of direct reclaim. Direct
reclaim is reclaim initiated by a task which is trying to allocate memory.
If a task cannot perform direct reclaim itself, it may ask kswapd to
attempt to reclaim memory for it.