mm, THP, swap: move anonymous THP split logic to vmscan
authorMinchan Kim <[email protected]>
Thu, 6 Jul 2017 22:37:24 +0000 (15:37 -0700)
committerLinus Torvalds <[email protected]>
Thu, 6 Jul 2017 23:24:31 +0000 (16:24 -0700)
commit0f0746589e4be071a8f890b2035c97c30c7a4e16
treefa4613c9460f97cb64176ad8fb93d3fb2b30ad36
parent75f6d6d29a40b5541f0f107201cf7dec134ad210
mm, THP, swap: move anonymous THP split logic to vmscan

The add_to_swap aims to allocate swap_space(ie, swap slot and swapcache)
so if it fails due to lack of space in case of THP or something(hdd swap
but tries THP swapout) *caller* rather than add_to_swap itself should
split the THP page and retry it with base page which is more natural.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Minchan Kim <[email protected]>
Signed-off-by: "Huang, Ying" <[email protected]>
Acked-by: 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: 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]>
include/linux/swap.h
mm/swap_state.c
mm/vmscan.c