On Thu 19-11-15 15:17:35, David Rientjes wrote: > On Wed, 18 Nov 2015, Michal Hocko wrote: [...] > > @@ -3167,24 +3166,21 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, > > > > /* > > * Do not retry high order allocations unless they are __GFP_REPEAT > > - * and even then do not retry endlessly unless explicitly told so > > + * unless explicitly told so. > > */ > > - pages_reclaimed += did_some_progress; > > - if (order > PAGE_ALLOC_COSTLY_ORDER) { > > - if (!(gfp_mask & __GFP_NOFAIL) && > > - (!(gfp_mask & __GFP_REPEAT) || pages_reclaimed >= (1<<order))) > > - goto noretry; > > - > > - if (did_some_progress) > > - goto retry; > > - } > > + if (order > PAGE_ALLOC_COSTLY_ORDER && > > + !(gfp_mask & (__GFP_REPEAT|__GFP_NOFAIL))) > > + goto noretry; > > Who is allocating order > PAGE_ALLOC_COSTLY_ORDER with __GFP_REPEAT and > would be affected by this change? E.g. hugetlb pages. I have tested this in my testing scenario 3. > > > > /* > > * Be optimistic and consider all pages on reclaimable LRUs as usable > > * but make sure we converge to OOM if we cannot make any progress after > > * multiple consecutive failed attempts. > > + * Costly __GFP_REPEAT allocations might have made a progress but this > > + * doesn't mean their order will become available due to high fragmentation > > + * so do not reset the backoff for them > > */ > > - if (did_some_progress) > > + if (did_some_progress && order <= PAGE_ALLOC_COSTLY_ORDER) > > stall_backoff = 0; > > else > > stall_backoff = min(stall_backoff+1, MAX_STALL_BACKOFF); > > This makes sense if there are high-order users of __GFP_REPEAT since > only using a number of pages reclaimed by itself isn't helpful. Yes, that was my thinking Thanks! -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>