Re: [PATCH] total_free_shortage() using zone_free_shortage()

Linus Torvalds (torvalds@transmeta.com)
Tue, 7 Aug 2001 21:00:26 -0700 (PDT)


On Mon, 6 Aug 2001, Marcelo Tosatti wrote:
>
> The following patch changes total_free_shortage() to use
> zone_free_shortage() to calculate the sum of perzone free shortages.

Marcelo, the patch looks ok per se, but I think the real _problem_ is that
you did the same mistake in do_page_launder() as you originally did in the
VM scanning.

The code should NOT use

if (zone && !zone_free_shortage(page->zone))
.. don't touch ..

because that is completely nonsensical anyway.

As with the VM scanning code, it should do

if (zone_free_plenty(page->zone))
.. don't touch ..

and you should make

zone_free_plenty(zone)
{
return zone->free_pages + zone->inactive_clean_pages > zone->max_free_pages;
}

and

zone_free_shortage(zone)
{
return zone->free_pages + zone->inactive_clean_pages < zone->low_free_pages;
}

Note the anti-hysteresis by using max_free_pages vs min_free_pages.

This will clean up the code (remove those silly "zone as a boolean"), and
I bet it will behave better too with less of a spike in behaviour around
"max_free_pages".

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/