diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 13:31:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-06 13:31:36 -0500 |
commit | 8dcd175bc3d50b78413c56d5b17d4bddd77412ef (patch) | |
tree | 2c2fb25759b43f2e73830f07ef3b444d76825280 /mm/hugetlb.c | |
parent | afe6fe7036c6efdcb46cabc64bec9b6e4a005210 (diff) | |
parent | fff04900ea79915939ef6a3aad78fca6511a3034 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton:
- a few misc things
- ocfs2 updates
- most of MM
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (159 commits)
tools/testing/selftests/proc/proc-self-syscall.c: remove duplicate include
proc: more robust bulk read test
proc: test /proc/*/maps, smaps, smaps_rollup, statm
proc: use seq_puts() everywhere
proc: read kernel cpu stat pointer once
proc: remove unused argument in proc_pid_lookup()
fs/proc/thread_self.c: code cleanup for proc_setup_thread_self()
fs/proc/self.c: code cleanup for proc_setup_self()
proc: return exit code 4 for skipped tests
mm,mremap: bail out earlier in mremap_to under map pressure
mm/sparse: fix a bad comparison
mm/memory.c: do_fault: avoid usage of stale vm_area_struct
writeback: fix inode cgroup switching comment
mm/huge_memory.c: fix "orig_pud" set but not used
mm/hotplug: fix an imbalance with DEBUG_PAGEALLOC
mm/memcontrol.c: fix bad line in comment
mm/cma.c: cma_declare_contiguous: correct err handling
mm/page_ext.c: fix an imbalance with kmemleak
mm/compaction: pass pgdat to too_many_isolated() instead of zone
mm: remove zone_lru_lock() function, access ->lru_lock directly
...
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); |