mm, THP, swap: enable THP swap optimization only if has compound map
authorHuang Ying <[email protected]>
Thu, 6 Jul 2017 22:37:31 +0000 (15:37 -0700)
committerLinus Torvalds <[email protected]>
Thu, 6 Jul 2017 23:24:31 +0000 (16:24 -0700)
commit747552b1e71b400fa32a221e072be2c0b7661f14
tree5f2e457a2b500159af4f7d98e62501ecd299c547
parentb8f593cd0896b8b14c2b494a9776531b5cd54d98
mm, THP, swap: enable THP swap optimization only if has compound map

If there is no compound map for a THP (Transparent Huge Page), it is
possible that the map count of some sub-pages of the THP is 0.  So it is
better to split the THP before swapping out.  In this way, the sub-pages
not mapped will be freed, and we can avoid the unnecessary swap out
operations for these sub-pages.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: "Huang, Ying" <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Ebru Akagunduz <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Shaohua Li <[email protected]>
Cc: Tejun Heo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/vmscan.c