From: Yang Shi Date: Fri, 17 Aug 2018 22:45:29 +0000 (-0700) Subject: mm: thp: inc counter for collapsed shmem THP X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=87aa752906ecf69842ef5ac1d0677aa75a4e0aac;p=linux.git mm: thp: inc counter for collapsed shmem THP /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed is used to record the counter of collapsed THP, but it just gets inc'ed in anonymous THP collapse path, do this for shmem THP collapse too. Link: http://lkml.kernel.org/r/1529622949-75504-2-git-send-email-yang.shi@linux.alibaba.com Signed-off-by: Yang Shi Acked-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 22da712022de3..79d55e10bca94 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1516,6 +1516,8 @@ tree_unlocked: unlock_page(new_page); *hpage = NULL; + + khugepaged_pages_collapsed++; } else { /* Something went wrong: rollback changes to the radix-tree */ shmem_uncharge(mapping->host, nr_none);