diff options
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 8dfdffc34a99..97b1e0290c66 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/swap.h> | 25 | #include <linux/swap.h> |
26 | #include <linux/swapops.h> | 26 | #include <linux/swapops.h> |
27 | #include <linux/jhash.h> | 27 | #include <linux/jhash.h> |
28 | #include <linux/numa.h> | ||
28 | 29 | ||
29 | #include <asm/page.h> | 30 | #include <asm/page.h> |
30 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
@@ -887,7 +888,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, | |||
887 | struct zonelist *zonelist; | 888 | struct zonelist *zonelist; |
888 | struct zone *zone; | 889 | struct zone *zone; |
889 | struct zoneref *z; | 890 | struct zoneref *z; |
890 | int node = -1; | 891 | int node = NUMA_NO_NODE; |
891 | 892 | ||
892 | zonelist = node_zonelist(nid, gfp_mask); | 893 | zonelist = node_zonelist(nid, gfp_mask); |
893 | 894 | ||
@@ -919,7 +920,7 @@ retry_cpuset: | |||
919 | /* Movability of hugepages depends on migration support. */ | 920 | /* Movability of hugepages depends on migration support. */ |
920 | static inline gfp_t htlb_alloc_mask(struct hstate *h) | 921 | static inline gfp_t htlb_alloc_mask(struct hstate *h) |
921 | { | 922 | { |
922 | if (hugepage_migration_supported(h)) | 923 | if (hugepage_movable_supported(h)) |
923 | return GFP_HIGHUSER_MOVABLE; | 924 | return GFP_HIGHUSER_MOVABLE; |
924 | else | 925 | else |
925 | return GFP_HIGHUSER; | 926 | return GFP_HIGHUSER; |
@@ -1586,8 +1587,8 @@ out_unlock: | |||
1586 | return page; | 1587 | return page; |
1587 | } | 1588 | } |
1588 | 1589 | ||
1589 | static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, | 1590 | struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, |
1590 | int nid, nodemask_t *nmask) | 1591 | int nid, nodemask_t *nmask) |
1591 | { | 1592 | { |
1592 | struct page *page; | 1593 | struct page *page; |
1593 | 1594 | ||
@@ -4398,10 +4399,12 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | |||
4398 | continue; | 4399 | continue; |
4399 | } | 4400 | } |
4400 | if (!huge_pte_none(pte)) { | 4401 | if (!huge_pte_none(pte)) { |
4401 | pte = huge_ptep_get_and_clear(mm, address, ptep); | 4402 | pte_t old_pte; |
4402 | pte = pte_mkhuge(huge_pte_modify(pte, newprot)); | 4403 | |
4404 | old_pte = huge_ptep_modify_prot_start(vma, address, ptep); | ||
4405 | pte = pte_mkhuge(huge_pte_modify(old_pte, newprot)); | ||
4403 | pte = arch_make_huge_pte(pte, vma, NULL, 0); | 4406 | pte = arch_make_huge_pte(pte, vma, NULL, 0); |
4404 | set_huge_pte_at(mm, address, ptep, pte); | 4407 | huge_ptep_modify_prot_commit(vma, address, ptep, old_pte, pte); |
4405 | pages++; | 4408 | pages++; |
4406 | } | 4409 | } |
4407 | spin_unlock(ptl); | 4410 | spin_unlock(ptl); |