diff mbox

[v2,2/2] mm: thp: inc counter for collapsed shmem THP

Message ID 1529622949-75504-2-git-send-email-yang.shi@linux.alibaba.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yang Shi June 21, 2018, 11:15 p.m. UTC
/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.

Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
---
v1 --> v2:
* Seperate from the previous patch per Kirill's comment

 mm/khugepaged.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

kirill.shutemov@linux.intel.com June 22, 2018, 8 a.m. UTC | #1
On Thu, Jun 21, 2018 at 11:15:49PM +0000, yang.shi@linux.alibaba.com wrote:
> /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.
> 
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
diff mbox

Patch

diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index 9b0ec30..4018826 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -1521,6 +1521,8 @@  static void collapse_shmem(struct mm_struct *mm,
 		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);