Free memory starvation in a zone?

From: Jeremy Linton (jlinton@interactivesi.com)
Date: Fri Aug 03 2001 - 12:25:35 EST


In kreclaimd() there is a nice loop that looks like

 for(i = 0; i < MAX_NR_ZONES; i++) {
    zone_t *zone = pgdat->node_zones + i;
    if (!zone->size)
        continue;

    while (zone->free_pages < zone->pages_low) {
        struct page * page;
        page = reclaim_page(zone);
        if (!page)
            break;
        __free_page(page);
    }
}

I was playing around with the page age algorithm when i noticed that it
appears that the machine will get into a state where the inner loop _NEVER_
exits the current zone because applications running in that zone are eating
the memory as fast as it is being freed up. I imaging that this could be
causing some pretty serious problems since the other zone's pages will only
get recleaimed during a page alloc. Maybe there should be a max number of
pages that can be reclaimed out of any given zone to force this loop to
break? Something like 5 or 10% of the zone?

Any comments?

BTW: I started playing with the page age system when I noticed that it
wasn't very evenly distributed. All the pages in a tend to fall into one or
two age groups pretty close to PAGE_AGE_START with a significant number of
them often below PAGE_AGE_START.

-
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/



This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:28 EST