[PATCH 15/15] fixup! mm, compaction: more reliably increase direct compaction priority

From: Vlastimil Babka
Date: Tue May 10 2016 - 08:51:03 EST


---
mm/page_alloc.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index fa49eb4a5919..e8a0d33cfb67 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3268,6 +3268,14 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,
}

/*
+ * Compaction considers all the zones as unfixably fragmented and we
+ * are on the highest priority, which means it can't be due to
+ * heuristics and it doesn't really make much sense to retry.
+ */
+ if (compaction_failed(compact_result))
+ return false;
+
+ /*
* The remaining possibility is that compaction made progress and
* created a high-order page, but it was allocated by somebody else.
* To prevent thrashing, limit the number of retries in such case.
--
2.8.2