]> Git Repo - linux.git/commit
mm, compaction: require only min watermarks for non-costly orders
authorVlastimil Babka <[email protected]>
Fri, 7 Oct 2016 23:58:00 +0000 (16:58 -0700)
committerLinus Torvalds <[email protected]>
Sat, 8 Oct 2016 01:46:27 +0000 (18:46 -0700)
commit8348faf91f56371d4bada6fc5915e19580a15ffe
tree4023e17d61c7607c09aaa17261483019003f6eed
parent984fdba6a32e4e9819ebc06ca3acec6582ffd99f
mm, compaction: require only min watermarks for non-costly orders

The __compaction_suitable() function checks the low watermark plus a
compact_gap() gap to decide if there's enough free memory to perform
compaction.  Then __isolate_free_page uses low watermark check to decide
if particular free page can be isolated.  In the latter case, using low
watermark is needlessly pessimistic, as the free page isolations are
only temporary.  For __compaction_suitable() the higher watermark makes
sense for high-order allocations where more freepages increase the
chance of success, and we can typically fail with some order-0 fallback
when the system is struggling to reach that watermark.  But for
low-order allocation, forming the page should not be that hard.  So
using low watermark here might just prevent compaction from even trying,
and eventually lead to OOM killer even if we are above min watermarks.

So after this patch, we use min watermark for non-costly orders in
__compaction_suitable(), and for all orders in __isolate_free_page().

[[email protected]: clarify __isolate_free_page() comment]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Vlastimil Babka <[email protected]>
Tested-by: Lorenzo Stoakes <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Rik van Riel <[email protected]>
Signed-off-by: Vlastimil Babka <[email protected]>
Tested-by: Lorenzo Stoakes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/compaction.c
mm/page_alloc.c
This page took 0.056741 seconds and 4 git commands to generate.