Re: [RFC 03/13] mm, page_alloc: don't retry initial attempt in slowpath

From: Joonsoo Kim
Date: Tue May 31 2016 - 02:24:12 EST


On Tue, May 10, 2016 at 09:35:53AM +0200, Vlastimil Babka wrote:
> After __alloc_pages_slowpath() sets up new alloc_flags and wakes up kswapd, it
> first tries get_page_from_freelist() with the new alloc_flags, as it may
> succeed e.g. due to using min watermark instead of low watermark. This attempt
> does not have to be retried on each loop, since direct reclaim, direct
> compaction and oom call get_page_from_freelist() themselves.

Hmm... there is a corner case. If did_some_progress is 0 or compaction
is deferred, get_page_from_freelist() isn't called. But, we can
succeed to allocate memory since there is a kswapd that reclaims
memory in background.

Thanks.