Skip to content

Commit 3a7200a

Browse files
Mel Gormantorvalds
Mel Gorman
authored andcommitted
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]>
1 parent 90c7a79 commit 3a7200a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/compaction.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,9 @@ void compact_pgdat(pg_data_t *pgdat, int order)
11311131
.sync = false,
11321132
};
11331133

1134+
if (!order)
1135+
return;
1136+
11341137
__compact_pgdat(pgdat, &cc);
11351138
}
11361139

0 commit comments

Comments
 (0)