Skip to content

Commit

Permalink
mm: compaction: do not compact pgdat for order-0
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Mel Gorman authored and torvalds committed Sep 11, 2013
1 parent 90c7a79 commit 3a7200a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/compaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,9 @@ void compact_pgdat(pg_data_t *pgdat, int order)
.sync = false,
};

if (!order)
return;

__compact_pgdat(pgdat, &cc);
}

Expand Down

0 comments on commit 3a7200a

Please sign in to comment.