mm: compaction: do not compact pgdat for order-0

If kswapd was reclaiming for a high order and resets it to 0 due to
fragmentation it will still call compact_pgdat.  For the most part, this
will fail a compaction_suitable() test and not compact but it is
unnecessarily sloppy.  It could be fixed in the caller but fix it in the
API instead.

[[email protected]: pointed out that it was a potential problem]
Signed-off-by: Mel Gorman <[email protected]>
Cc: Hillf Danton <[email protected]>
Acked-by: Minchan Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Mel Gorman 2013-09-11 14:22:19 -07:00 • committed by Linus Torvalds
commit 3a7200af3d

View file

@ -1131,6 +1131,9 @@ void compact_pgdat(pg_data_t *pgdat, int order)
.sync = false,
};
if (!order)
return;
__compact_pgdat(pgdat, &cc);
}