]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/compaction.c
cpuidle: fix fallback mechanism for suspend to idle in absence of enter_freeze
[mirror_ubuntu-zesty-kernel.git] / mm / compaction.c
index a8e659398fdf1285636fac54fe50d1a675af4e69..de3e1e71cd9f265d9df971e98ed931fbdc8611a8 100644 (file)
@@ -35,17 +35,6 @@ static inline void count_compact_events(enum vm_event_item item, long delta)
 #endif
 
 #if defined CONFIG_COMPACTION || defined CONFIG_CMA
-#ifdef CONFIG_TRACEPOINTS
-static const char *const compaction_status_string[] = {
-       "deferred",
-       "skipped",
-       "continue",
-       "partial",
-       "complete",
-       "no_suitable_page",
-       "not_suitable_zone",
-};
-#endif
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/compaction.h>
@@ -1213,7 +1202,7 @@ static int __compact_finished(struct zone *zone, struct compact_control *cc,
        unsigned long watermark;
 
        if (cc->contended || fatal_signal_pending(current))
-               return COMPACT_PARTIAL;
+               return COMPACT_CONTENDED;
 
        /* Compaction run completes if the migrate and free scanner meet */
        if (compact_scanners_met(cc)) {
@@ -1404,7 +1393,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
 
                switch (isolate_migratepages(zone, cc)) {
                case ISOLATE_ABORT:
-                       ret = COMPACT_PARTIAL;
+                       ret = COMPACT_CONTENDED;
                        putback_movable_pages(&cc->migratepages);
                        cc->nr_migratepages = 0;
                        goto out;
@@ -1435,7 +1424,7 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
                         * and we want compact_finished() to detect it
                         */
                        if (err == -ENOMEM && !compact_scanners_met(cc)) {
-                               ret = COMPACT_PARTIAL;
+                               ret = COMPACT_CONTENDED;
                                goto out;
                        }
                }
@@ -1488,6 +1477,9 @@ out:
        trace_mm_compaction_end(start_pfn, cc->migrate_pfn,
                                cc->free_pfn, end_pfn, sync, ret);
 
+       if (ret == COMPACT_CONTENDED)
+               ret = COMPACT_PARTIAL;
+
        return ret;
 }