aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/compaction.h3
-rw-r--r--mm/compaction.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index e88c037afe47..a1fba9994728 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -6,8 +6,9 @@
6 * Lower value means higher priority, analogically to reclaim priority. 6 * Lower value means higher priority, analogically to reclaim priority.
7 */ 7 */
8enum compact_priority { 8enum compact_priority {
9 COMPACT_PRIO_SYNC_FULL,
10 MIN_COMPACT_PRIORITY = COMPACT_PRIO_SYNC_FULL,
9 COMPACT_PRIO_SYNC_LIGHT, 11 COMPACT_PRIO_SYNC_LIGHT,
10 MIN_COMPACT_PRIORITY = COMPACT_PRIO_SYNC_LIGHT,
11 DEF_COMPACT_PRIORITY = COMPACT_PRIO_SYNC_LIGHT, 12 DEF_COMPACT_PRIORITY = COMPACT_PRIO_SYNC_LIGHT,
12 COMPACT_PRIO_ASYNC, 13 COMPACT_PRIO_ASYNC,
13 INIT_COMPACT_PRIORITY = COMPACT_PRIO_ASYNC 14 INIT_COMPACT_PRIORITY = COMPACT_PRIO_ASYNC
diff --git a/mm/compaction.c b/mm/compaction.c
index 2e1113ff7a03..21040304f4d2 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1644,6 +1644,8 @@ static enum compact_result compact_zone_order(struct zone *zone, int order,
1644 .alloc_flags = alloc_flags, 1644 .alloc_flags = alloc_flags,
1645 .classzone_idx = classzone_idx, 1645 .classzone_idx = classzone_idx,
1646 .direct_compaction = true, 1646 .direct_compaction = true,
1647 .whole_zone = (prio == MIN_COMPACT_PRIORITY),
1648 .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY)
1647 }; 1649 };
1648 INIT_LIST_HEAD(&cc.freepages); 1650 INIT_LIST_HEAD(&cc.freepages);
1649 INIT_LIST_HEAD(&cc.migratepages); 1651 INIT_LIST_HEAD(&cc.migratepages);
@@ -1689,7 +1691,8 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
1689 ac->nodemask) { 1691 ac->nodemask) {
1690 enum compact_result status; 1692 enum compact_result status;
1691 1693
1692 if (compaction_deferred(zone, order)) { 1694 if (prio > MIN_COMPACT_PRIORITY
1695 && compaction_deferred(zone, order)) {
1693 rc = max_t(enum compact_result, COMPACT_DEFERRED, rc); 1696 rc = max_t(enum compact_result, COMPACT_DEFERRED, rc);
1694 continue; 1697 continue;
1695 } 1698 }