Re: OOM problems with 2.6.11-rc4

Andrea Arcangeli
2005-03-16T18:39:38Z

On Wed, Mar 16, 2005 at 04:04:35AM -0800, Andrew Morton wrote:
> > + if (!reclaim_state->reclaimed_slab &&
> > + zone->pages_scanned >= (zone->nr_active +
> > + zone->nr_inactive) * 4)
> > zone->all_unreclaimable = 1;
>
> That might not change anything because we clear ->all_unreclaimable in
> free_page_bulk(). [..]

Really? free_page_bulk is called inside shrink_slab, and so it's overwritten
later by all_unreclaimable. Otherwise how could all_unreclaimable be set
in the first place if a single page freed by shrink_slab would be enough
to clear it?

shrink_slab
all_unreclaimable = 0
zone->pages_scanned >= (zone->nr_active [..]
all_unreclaimable = 1

try_to_free_pages
all_unreclaimable == 1
oom

I also considering changing shrink_slab to return a progress retval, but
then I noticed I could get away with a one liner fix ;).

Your fix is better but it should be mostly equivalent in pratcie. I
liked the dontrylock not risking to go oom, the one liner couldn't
handle that ;).

thanks!