vmscan: split file huge pages before paging them out
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tue, 26 Jul 2016 22:25:56 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 23:19:19 +0000 (16:19 -0700)
This is preparation of vmscan for file huge pages.  We cannot write out
huge pages, so we need to split them on the way out.

Link: http://lkml.kernel.org/r/1466021202-61880-22-git-send-email-kirill.shutemov@linux.intel.com
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c

index 93ba337..21d417c 100644 (file)
@@ -1055,8 +1055,14 @@ static unsigned long shrink_page_list(struct list_head *page_list,
 
                        /* Adding to swap updated mapping */
                        mapping = page_mapping(page);
+               } else if (unlikely(PageTransHuge(page))) {
+                       /* Split file THP */
+                       if (split_huge_page_to_list(page, page_list))
+                               goto keep_locked;
                }
 
+               VM_BUG_ON_PAGE(PageTransHuge(page), page);
+
                /*
                 * The page is mapped into the page tables of one or more
                 * processes. Try to unmap it here.