Re: [RFC 12/13] mm, compaction: more reliably increase direct compaction priority

From: Vlastimil Babka
Date: Tue May 10 2016 - 08:55:30 EST


On 05/10/2016 09:36 AM, Vlastimil Babka wrote:
> /*
> - * compaction considers all the zone as desperately out of memory
> - * so it doesn't really make much sense to retry except when the
> - * failure could be caused by insufficient priority
> + * Compaction backed off due to watermark checks for order-0
> + * so the regular reclaim has to try harder and reclaim something
> + * Retry only if it looks like reclaim might have a chance.
> */
> - if (compaction_failed(compact_result)) {
> - if (*compact_priority > 0) {
> - (*compact_priority)--;
> - return true;
> - }
> - return false;
> - }

Oops, looks like my editing resulted in compaction_failed() check to be
removed completely, which wasn't intentional and can lead to infinite
loops. This should be added on top.

----8<----