]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - mm/hugetlb.c
Merge branch 'page-refs' (page ref overflow)
[thirdparty/kernel/linux.git] / mm / hugetlb.c
index c220315dc5331f74817dc1d05c5fc411bec80ae8..6cdc7b2d910039a5e9f4fb4724c34ad8e2216c45 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/swap.h>
 #include <linux/swapops.h>
 #include <linux/jhash.h>
+#include <linux/numa.h>
 
 #include <asm/page.h>
 #include <asm/pgtable.h>
@@ -887,7 +888,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask,
        struct zonelist *zonelist;
        struct zone *zone;
        struct zoneref *z;
-       int node = -1;
+       int node = NUMA_NO_NODE;
 
        zonelist = node_zonelist(nid, gfp_mask);
 
@@ -919,7 +920,7 @@ retry_cpuset:
 /* Movability of hugepages depends on migration support. */
 static inline gfp_t htlb_alloc_mask(struct hstate *h)
 {
-       if (hugepage_migration_supported(h))
+       if (hugepage_movable_supported(h))
                return GFP_HIGHUSER_MOVABLE;
        else
                return GFP_HIGHUSER;
@@ -1586,8 +1587,8 @@ out_unlock:
        return page;
 }
 
-static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask,
-               int nid, nodemask_t *nmask)
+struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask,
+                                    int nid, nodemask_t *nmask)
 {
        struct page *page;
 
@@ -4411,10 +4412,12 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
                        continue;
                }
                if (!huge_pte_none(pte)) {
-                       pte = huge_ptep_get_and_clear(mm, address, ptep);
-                       pte = pte_mkhuge(huge_pte_modify(pte, newprot));
+                       pte_t old_pte;
+
+                       old_pte = huge_ptep_modify_prot_start(vma, address, ptep);
+                       pte = pte_mkhuge(huge_pte_modify(old_pte, newprot));
                        pte = arch_make_huge_pte(pte, vma, NULL, 0);
-                       set_huge_pte_at(mm, address, ptep, pte);
+                       huge_ptep_modify_prot_commit(vma, address, ptep, old_pte, pte);
                        pages++;
                }
                spin_unlock(ptl);