Re: [rfc] [patch] mm: zone_reclaim fix for pseudo file systems

Andrew Morton
2007-07-31T00:20:07Z

On Mon, 30 Jul 2007 17:01:38 -0700
Ravikiran G Thirumalai <kiran@scalex86.org> wrote:

> >The (cheesy) way in which reclaim currently handles this sort of thing is
> >to scan like mad, then to eventually set zone->all_unreclaimable. Once
> >that has been set, the kernel will reduce the amount of scanning effort it
> >puts into that zone by a very large amount. If the zone later comes back
> >to life, all_unreclaimable gets cleared and things proceed as normal.
>
> I see. But this obviously does not work in this case. I have noticed the
> process getting into 'system' and staying there for hours. I have never
> noticed the app complete. Perhaps because I did not wait long enough.
> So do you think a more aggressive auto setting/unsetting of 'all_unreclaimable'
> is a better approach?

The problem is that __zone_reclaim() doesn't use all_unreclaimable at all.
You'll note that all the other callers of shrink_zone() do take avoiding
action if the zone is in all_unreclaimable state, but __zone_reclaim() forgot
to.

Fixing that could/should fix your CPU consumption problem. It will further
propagate the existing lameness, but replacing all_unreclaimable with something
more efficient, more accurate and more complex is a separate problem.