]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/rmap.c
thp: introduce deferred_split_huge_page()
[mirror_ubuntu-artful-kernel.git] / mm / rmap.c
index fc707df92ede52fb9c071334365dc52cb8cc6ecc..84271cc39d1ea816ca9bfa567f2d305f000a054c 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1282,8 +1282,10 @@ static void page_remove_anon_compound_rmap(struct page *page)
                nr = HPAGE_PMD_NR;
        }
 
-       if (nr)
+       if (nr) {
                __mod_zone_page_state(page_zone(page), NR_ANON_PAGES, -nr);
+               deferred_split_huge_page(page);
+       }
 }
 
 /**
@@ -1318,6 +1320,9 @@ void page_remove_rmap(struct page *page, bool compound)
        if (unlikely(PageMlocked(page)))
                clear_page_mlock(page);
 
+       if (PageTransCompound(page))
+               deferred_split_huge_page(compound_head(page));
+
        /*
         * It would be tidy to reset the PageAnon mapping here,
         * but that might overwrite a racing page_add_anon_rmap