These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / mm / swap.c
index 1785ac6..ca194ae 100644 (file)
@@ -31,8 +31,9 @@
 #include <linux/memcontrol.h>
 #include <linux/gfp.h>
 #include <linux/uio.h>
-#include <linux/hugetlb.h>
 #include <linux/locallock.h>
+#include <linux/hugetlb.h>
+#include <linux/page_idle.h>
 
 #include "internal.h"
 
@@ -135,7 +136,6 @@ void put_unrefcounted_compound_page(struct page *page_head, struct page *page)
                 * here, see the comment above this function.
                 */
                VM_BUG_ON_PAGE(!PageHead(page_head), page_head);
-               VM_BUG_ON_PAGE(page_mapcount(page) != 0, page);
                if (put_page_testzero(page_head)) {
                        /*
                         * If this is the tail of a slab THP page,
@@ -205,7 +205,7 @@ out_put_single:
                                __put_single_page(page);
                        return;
                }
-               VM_BUG_ON_PAGE(page_head != page->first_page, page);
+               VM_BUG_ON_PAGE(page_head != compound_head(page), page);
                /*
                 * We can release the refcount taken by
                 * get_page_unless_zero() now that
@@ -266,7 +266,7 @@ static void put_compound_page(struct page *page)
         *  Case 3 is possible, as we may race with
         *  __split_huge_page_refcount tearing down a THP page.
         */
-       page_head = compound_head_by_tail(page);
+       page_head = compound_head(page);
        if (!__compound_tail_refcounted(page_head))
                put_unrefcounted_compound_page(page_head, page);
        else
@@ -628,6 +628,8 @@ void mark_page_accessed(struct page *page)
        } else if (!PageReferenced(page)) {
                SetPageReferenced(page);
        }
+       if (page_is_idle(page))
+               clear_page_idle(page);
 }
 EXPORT_SYMBOL(mark_page_accessed);