path: root/fs
diff options
authorDavid Rientjes <>2016-06-24 14:50:10 -0700
committerLinus Torvalds <>2016-06-24 17:23:52 -0700
commita4f04f2c6955aff5e2c08dcb40aca247ff4d7370 (patch)
tree89db07df7889aae04c766389595fabe40880e824 /fs
parent5c335fe020ea287b2b49cc4dfca9f6756b88bb71 (diff)
mm, compaction: abort free scanner if split fails
If the memory compaction free scanner cannot successfully split a free page (only possible due to per-zone low watermark), terminate the free scanner rather than continuing to scan memory needlessly. If the watermark is insufficient for a free page of order <= cc->order, then terminate the scanner since all future splits will also likely fail. This prevents the compaction freeing scanner from scanning all memory on very large zones (very noticeable for zones > 128GB, for instance) when all splits will likely fail while holding zone->lock. compaction_alloc() iterating a 128GB zone has been benchmarked to take over 400ms on some systems whereas any free page isolated and ready to be split ends up failing in split_free_page() because of the low watermark check and thus the iteration continues. The next time compaction occurs, the freeing scanner will likely start at the end of the zone again since no success was made previously and we get the same lengthy iteration until the zone is brought above the low watermark. All thp page faults can take >400ms in such a state without this fix. Link: Signed-off-by: David Rientjes <> Acked-by: Vlastimil Babka <> Cc: Minchan Kim <> Cc: Joonsoo Kim <> Cc: Mel Gorman <> Cc: Hugh Dickins <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions