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/