vmscan: only defer compaction for failed order and higher
authorRik van Riel <[email protected]>
Wed, 21 Mar 2012 23:33:52 +0000 (16:33 -0700)
committerLinus Torvalds <[email protected]>
Thu, 22 Mar 2012 00:54:56 +0000 (17:54 -0700)
commitaff622495c9a0b56148192e53bdec539f5e147f2
tree78f6400d8b6bec3279483006a0e9543e47aa833e
parent7be62de99adcab4449d416977b4274985c5fe023
vmscan: only defer compaction for failed order and higher

Currently a failed order-9 (transparent hugepage) compaction can lead to
memory compaction being temporarily disabled for a memory zone.  Even if
we only need compaction for an order 2 allocation, eg.  for jumbo frames
networking.

The fix is relatively straightforward: keep track of the highest order at
which compaction is succeeding, and only defer compaction for orders at
which compaction is failing.

Signed-off-by: Rik van Riel <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Hillf Danton <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/compaction.h
include/linux/mmzone.h
mm/compaction.c
mm/page_alloc.c
mm/vmscan.c