From: Minchan Kim Date: Tue, 21 Aug 2012 23:16:03 +0000 (-0700) Subject: mm/compaction.c: fix deferring compaction mistake X-Git-Tag: v3.6-rc3~8^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c81758fbe0fdbbc0c74b37798f55bd9c91d5c068;p=platform%2Fupstream%2Fkernel-adaptation-pc.git mm/compaction.c: fix deferring compaction mistake Commit aff622495c9a ("vmscan: only defer compaction for failed order and higher") fixed bad deferring policy but made mistake about checking compact_order_failed in __compact_pgdat(). So it can't update compact_order_failed with the new order. This ends up preventing correct operation of policy deferral. This patch fixes it. Signed-off-by: Minchan Kim Reviewed-by: Rik van Riel Acked-by: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/compaction.c b/mm/compaction.c index e78cb96..b6984e2 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -861,7 +861,7 @@ static int __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc) if (cc->order > 0) { int ok = zone_watermark_ok(zone, cc->order, low_wmark_pages(zone), 0, 0); - if (ok && cc->order > zone->compact_order_failed) + if (ok && cc->order >= zone->compact_order_failed) zone->compact_order_failed = cc->order + 1; /* Currently async compaction is never deferred. */ else if (!ok && cc->sync)