Skip to content

Commit 06d3eff

Browse files
kiryltorvalds
authored andcommitted
mm/thp: fix node page state in split_huge_page_to_list()
Make sure split_huge_page_to_list() handles the state of shmem THP and file THP properly. Link: http://lkml.kernel.org/r/[email protected] Fixes: 60fbf0a ("mm,thp: stats for file backed THP") Signed-off-by: Kirill A. Shutemov <[email protected]> Signed-off-by: Song Liu <[email protected]> Tested-by: Song Liu <[email protected]> Acked-by: Yang Shi <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Srikar Dronamraju <[email protected]> Cc: William Kucharski <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2be5fbf commit 06d3eff

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

mm/huge_memory.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,8 +2789,13 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
27892789
ds_queue->split_queue_len--;
27902790
list_del(page_deferred_list(head));
27912791
}
2792-
if (mapping)
2793-
__dec_node_page_state(page, NR_SHMEM_THPS);
2792+
if (mapping) {
2793+
if (PageSwapBacked(page))
2794+
__dec_node_page_state(page, NR_SHMEM_THPS);
2795+
else
2796+
__dec_node_page_state(page, NR_FILE_THPS);
2797+
}
2798+
27942799
spin_unlock(&ds_queue->split_queue_lock);
27952800
__split_huge_page(page, list, end, flags);
27962801
if (PageSwapCache(head)) {

0 commit comments

Comments
 (0)