summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2016-10-07 20:00:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-07 21:46:29 -0400
commitc2033b00dbe856909fcaccf038e4e0d3dcfb85af (patch)
tree866c7d2177b8547188ecde9879e687d2e98ad5ab /mm/page_alloc.c
parentd943649831aba0fcdda37a0e9e25b332a634cf5e (diff)
mm, compaction: restrict full priority to non-costly orders
The new ultimate compaction priority disables some heuristics, which may result in excessive cost. This is fine for non-costly orders where we want to try hard before resulting for OOM, but might be disruptive for costly orders which do not trigger OOM and should generally have some fallback. Thus, we disable the full priority for costly orders. Suggested-by: Michal Hocko <mhocko@kernel.org> Link: http://lkml.kernel.org/r/20160906135258.18335-4-vbabka@suse.cz Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Cc: Michal Hocko <mhocko@kernel.org> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: David Rientjes <rientjes@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a8703b592c39..891e3881a6e0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3163,6 +3163,7 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,
3163 int *compaction_retries) 3163 int *compaction_retries)
3164{ 3164{
3165 int max_retries = MAX_COMPACT_RETRIES; 3165 int max_retries = MAX_COMPACT_RETRIES;
3166 int min_priority;
3166 3167
3167 if (!order) 3168 if (!order)
3168 return false; 3169 return false;
@@ -3205,7 +3206,9 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,
3205 * all retries or failed at the lower priorities. 3206 * all retries or failed at the lower priorities.
3206 */ 3207 */
3207check_priority: 3208check_priority:
3208 if (*compact_priority > MIN_COMPACT_PRIORITY) { 3209 min_priority = (order > PAGE_ALLOC_COSTLY_ORDER) ?
3210 MIN_COMPACT_COSTLY_PRIORITY : MIN_COMPACT_PRIORITY;
3211 if (*compact_priority > min_priority) {
3209 (*compact_priority)--; 3212 (*compact_priority)--;
3210 *compaction_retries = 0; 3213 *compaction_retries = 0;
3211 return true; 3214 return true;