aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 3d64b369180d..0b78fb9ea65b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -946,15 +946,18 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
946 nodemask_t nmask; 946 nodemask_t nmask;
947 LIST_HEAD(pagelist); 947 LIST_HEAD(pagelist);
948 int err = 0; 948 int err = 0;
949 struct vm_area_struct *vma;
950 949
951 nodes_clear(nmask); 950 nodes_clear(nmask);
952 node_set(source, nmask); 951 node_set(source, nmask);
953 952
954 vma = check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask, 953 /*
954 * This does not "check" the range but isolates all pages that
955 * need migration. Between passing in the full user address
956 * space range and MPOL_MF_DISCONTIG_OK, this call can not fail.
957 */
958 VM_BUG_ON(!(flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)));
959 check_range(mm, mm->mmap->vm_start, mm->task_size, &nmask,
955 flags | MPOL_MF_DISCONTIG_OK, &pagelist); 960 flags | MPOL_MF_DISCONTIG_OK, &pagelist);
956 if (IS_ERR(vma))
957 return PTR_ERR(vma);
958 961
959 if (!list_empty(&pagelist)) { 962 if (!list_empty(&pagelist)) {
960 err = migrate_pages(&pagelist, new_node_page, dest, 963 err = migrate_pages(&pagelist, new_node_page, dest,