Commit fe490cc0 authored by Huang Ying's avatar Huang Ying Committed by Linus Torvalds

mm, THP, swap: add THP swapping out fallback counting

When swapping out THP (Transparent Huge Page), instead of swapping out
the THP as a whole, sometimes we have to fallback to split the THP into
normal pages before swapping, because no free swap clusters are
available, or cgroup limit is exceeded, etc.  To count the number of the
fallback, a new VM event THP_SWPOUT_FALLBACK is added, and counted when
we fallback to split the THP.

Link: default avatar"Huang, Ying" <>
Cc: Johannes Weiner <>
Cc: Minchan Kim <>
Cc: Hugh Dickins <>
Cc: Shaohua Li <>
Cc: Rik van Riel <>
Cc: Andrea Arcangeli <>
Cc: "Kirill A . Shutemov" <>
Cc: Michal Hocko <>
Cc: Dan Williams <>
Cc: Jens Axboe <>
Cc: Ross Zwisler <> [for brd.c, zram_drv.c, pmem.c]
Cc: Vishal L Verma <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent bd4c82c2
......@@ -86,6 +86,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
......@@ -1154,6 +1154,9 @@ static unsigned long shrink_page_list(struct list_head *page_list,
if (split_huge_page_to_list(page,
goto activate_locked;
if (!add_to_swap(page))
goto activate_locked;
......@@ -1072,6 +1072,7 @@ const char * const vmstat_text[] = {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment