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

Andrew Morton
2007-07-30T20:23:14Z

On Fri, 27 Jul 2007 16:27:53 -0700
Ravikiran G Thirumalai <kiran@scalex86.org> wrote:

> Don't go into zone_reclaim if there are no reclaimable pages.
>
> While using RAMFS as scratch space for some tests, we found one of the
> processes got into zone reclaim, and got stuck trying to reclaim pages
> from a zone.

Would like to see an expanded definition of "stuck", please ;)

ie: let's see the bug report before we see the fix?

> On examination of the code, we found that the VM was fooled
> into believing that the zone had reclaimable pages, when it actually had
> RAMFS backed pages, which could not be written back to the disk.
>
> Fix this by adding a zvc "NR_PSEUDO_FS_PAGES" for file pages with no
> backing store, and using this counter to determine if reclaim is possible.
>
> Patch tested,on 2.6.22. Fixes the above mentioned problem.

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.

All a bit nasty, but it has the advantage of covering _all_ these
scenarios, while a more precise fix such as the one you propose covers only
one of them.

So... perhaps zone_reclaim() is failing to honour the all_unreclaimable
thing in some fashion?

> Comments?

It is a numa-specific change which adds overhead to non-NUMA builds :(