aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index a37a5034f63d..83369058ec13 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -729,7 +729,11 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask,
729 } else { 729 } else {
730 *policy = pol == &default_policy ? MPOL_DEFAULT : 730 *policy = pol == &default_policy ? MPOL_DEFAULT :
731 pol->mode; 731 pol->mode;
732 *policy |= pol->flags; 732 /*
733 * Internal mempolicy flags must be masked off before exposing
734 * the policy to userspace.
735 */
736 *policy |= (pol->flags & MPOL_MODE_FLAGS);
733 } 737 }
734 738
735 if (vma) { 739 if (vma) {
@@ -799,7 +803,6 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
799int do_migrate_pages(struct mm_struct *mm, 803int do_migrate_pages(struct mm_struct *mm,
800 const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags) 804 const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags)
801{ 805{
802 LIST_HEAD(pagelist);
803 int busy = 0; 806 int busy = 0;
804 int err = 0; 807 int err = 0;
805 nodemask_t tmp; 808 nodemask_t tmp;
@@ -1477,7 +1480,7 @@ struct zonelist *huge_zonelist(struct vm_area_struct *vma, unsigned long addr,
1477 1480
1478 if (unlikely((*mpol)->mode == MPOL_INTERLEAVE)) { 1481 if (unlikely((*mpol)->mode == MPOL_INTERLEAVE)) {
1479 zl = node_zonelist(interleave_nid(*mpol, vma, addr, 1482 zl = node_zonelist(interleave_nid(*mpol, vma, addr,
1480 HPAGE_SHIFT), gfp_flags); 1483 huge_page_shift(hstate_vma(vma))), gfp_flags);
1481 } else { 1484 } else {
1482 zl = policy_zonelist(gfp_flags, *mpol); 1485 zl = policy_zonelist(gfp_flags, *mpol);
1483 if ((*mpol)->mode == MPOL_BIND) 1486 if ((*mpol)->mode == MPOL_BIND)
@@ -2216,9 +2219,12 @@ static void check_huge_range(struct vm_area_struct *vma,
2216{ 2219{
2217 unsigned long addr; 2220 unsigned long addr;
2218 struct page *page; 2221 struct page *page;
2222 struct hstate *h = hstate_vma(vma);
2223 unsigned long sz = huge_page_size(h);
2219 2224
2220 for (addr = start; addr < end; addr += HPAGE_SIZE) { 2225 for (addr = start; addr < end; addr += sz) {
2221 pte_t *ptep = huge_pte_offset(vma->vm_mm, addr & HPAGE_MASK); 2226 pte_t *ptep = huge_pte_offset(vma->vm_mm,
2227 addr & huge_page_mask(h));
2222 pte_t pte; 2228 pte_t pte;
2223 2229
2224 if (!ptep) 2230 if (!ptep)