Re: shrink_mmap() change in ac-21

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Jun 20 2000 - 15:26:59 EST


In article <Pine.LNX.4.21.0006201258190.12944-100000@duckman.distro.conectiva>,
Rik van Riel <riel@conectiva.com.br> wrote:
>
>I didn't know for sure either until I tested -ac21 on my
>192MB workstation. The bursts kswapd went through when
>it was freeing DMA memory (and 8MB of other memory) have
>convinced me that this is not a good idea.

Note that this is exactly what the zone "goodness" test is supposed to
avoid.

I suspect that the problem is that the goodness test is wrong. It should
overlook pages in zones that do not need balancing, rather than in zones
that have tons of free memory. Ie, I think the test should be of the
form

        if (page->zone->zone_wake_kswapd)
                /* uninteresting page */

rather than the current test

        if (page->zone->free_pages > page->zone->pages_high)
                /* uninteresting page */

Note that once the zone has actually been low on memory, the two tests
are equivalent: zone_wake_kswapd gets zeroed when the zone memory goes
over "pages_high". But zone_wake_kswapd will have the anti-hysteresis
behaviour that we want (ie it won't start freeing pages from
well-equipped zones until those zones have actually dipped below a "this
zone is startign to be a problem" mark).

The zone test is _definitely_ needed, because without that test we'll
deplete zones that have tons of memory and really should not be depleted..

                Linus

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



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:20 EST