Re: [PATCH 1/5] vmscan: remove all_unreclaimable check from direct reclaim path completely

From: KOSAKI Motohiro
Date: Thu Mar 24 2011 - 01:35:38 EST


Hi Minchan,

> Nick's original goal is to prevent OOM killing until all zone we're
> interested in are unreclaimable and whether zone is reclaimable or not
> depends on kswapd. And Nick's original solution is just peeking
> zone->all_unreclaimable but I made it dirty when we are considering
> kswapd freeze in hibernation. So I think we still need it to handle
> kswapd freeze problem and we should add original behavior we missed at
> that time like below.
>
> static bool zone_reclaimable(struct zone *zone)
> {
> if (zone->all_unreclaimable)
> return false;
>
> return zone->pages_scanned < zone_reclaimable_pages(zone) * 6;
> }
>
> If you remove the logic, the problem Nick addressed would be showed
> up, again. How about addressing the problem in your patch? If you
> remove the logic, __alloc_pages_direct_reclaim lose the chance calling
> dran_all_pages. Of course, it was a side effect but we should handle
> it.

Ok, you are successfull to persuade me. lost drain_all_pages() chance has
a risk.

> And my last concern is we are going on right way?


> I think fundamental cause of this problem is page_scanned and
> all_unreclaimable is race so isn't the approach fixing the race right
> way?

Hmm..
If we can avoid lock, we should. I think. that's performance reason.
therefore I'd like to cap the issue in do_try_to_free_pages(). it's
slow path.

Is the following patch acceptable to you? it is
o rewrote the description
o avoid mix to use zone->all_unreclaimable and zone->pages_scanned
o avoid to reintroduce hibernation issue
o don't touch fast path


> If it is hard or very costly, your and my approach will be fallback.

-----------------------------------------------------------------