]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-compaction-abort-compaction-loop-if-lock-is-contended-or-run-too-long-fix-2
authorMel Gorman <mgorman@suse.de>
Fri, 28 Sep 2012 00:19:44 +0000 (10:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 8 Oct 2012 03:00:11 +0000 (14:00 +1100)
o Fix BUG_ON triggered due to pages left on cc.migratepages
o Make compact_zone_order() require non-NULL arg `contended'

[minchan@kernel.org: Putback pages isolated for migration if aborting]
[akpm@linux-foundation.org: compact_zone_order requires non-NULL arg contended]
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/compaction.c

index 7c3bd79b3310f95d479fd996699118b173fb59cf..0649cc1b3479daf56bc1a3b995b7c5c5ef59dd9d 100644 (file)
@@ -847,6 +847,8 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
                switch (isolate_migratepages(zone, cc)) {
                case ISOLATE_ABORT:
                        ret = COMPACT_PARTIAL;
+                       putback_lru_pages(&cc->migratepages);
+                       cc->nr_migratepages = 0;
                        goto out;
                case ISOLATE_NONE:
                        continue;
@@ -909,6 +911,10 @@ static unsigned long compact_zone_order(struct zone *zone,
        INIT_LIST_HEAD(&cc.migratepages);
 
        ret = compact_zone(zone, &cc);
+
+       VM_BUG_ON(!list_empty(&cc.freepages));
+       VM_BUG_ON(!list_empty(&cc.migratepages));
+
        *contended = cc.contended;
        return ret;
 }