VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Marek Szyprowski <m.szyprowski@samsung.com> 2021-10-18 15:16:19 -0700 committer: Linus Torvalds <torvalds@linux-foundation.org> 2021-10-18 20:22:03 -1000 commit: 1ca7554d05ac038c98271f8968ed821266ecaa9c parent: 79f9bc5843142b649575f887dccdf1c07ad75c20
Commit Summary:
mm/thp: decrease nr_thps in file's mapping on THP split
Diffstat:
1 file changed, 4 insertions, 2 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 5e9ef0fc261e..92192cb086c7 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2700,12 +2700,14 @@ int split_huge_page_to_list(struct page *page, struct list_head *list)
 		if (mapping) {
 			int nr = thp_nr_pages(head);
 
-			if (PageSwapBacked(head))
+			if (PageSwapBacked(head)) {
 				__mod_lruvec_page_state(head, NR_SHMEM_THPS,
 							-nr);
-			else
+			} else {
 				__mod_lruvec_page_state(head, NR_FILE_THPS,
 							-nr);
+				filemap_nr_thps_dec(mapping);
+			}
 		}
 
 		__split_huge_page(page, list, end);