]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/mempolicy.c
thp: split_huge_page_mm/vma
[karo-tx-linux.git] / mm / mempolicy.c
index 11ff260fb282b778657a872aec0947d5f15616c6..83b7df309fc4937ee4de27be733018d955980221 100644 (file)
@@ -514,6 +514,7 @@ static inline int check_pmd_range(struct vm_area_struct *vma, pud_t *pud,
        pmd = pmd_offset(pud, addr);
        do {
                next = pmd_addr_end(addr, end);
+               split_huge_page_pmd(vma->vm_mm, pmd);
                if (pmd_none_or_clear_bad(pmd))
                        continue;
                if (check_pte_range(vma, pmd, addr, next, nodes,
@@ -935,7 +936,8 @@ static int migrate_to_node(struct mm_struct *mm, int source, int dest,
                return PTR_ERR(vma);
 
        if (!list_empty(&pagelist)) {
-               err = migrate_pages(&pagelist, new_node_page, dest, 0);
+               err = migrate_pages(&pagelist, new_node_page, dest,
+                                                               false, true);
                if (err)
                        putback_lru_pages(&pagelist);
        }
@@ -1155,7 +1157,8 @@ static long do_mbind(unsigned long start, unsigned long len,
 
                if (!list_empty(&pagelist)) {
                        nr_failed = migrate_pages(&pagelist, new_vma_page,
-                                               (unsigned long)vma, 0);
+                                               (unsigned long)vma,
+                                               false, true);
                        if (nr_failed)
                                putback_lru_pages(&pagelist);
                }
@@ -1308,16 +1311,13 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
 
        /* Find the mm_struct */
        rcu_read_lock();
-       read_lock(&tasklist_lock);
        task = pid ? find_task_by_vpid(pid) : current;
        if (!task) {
-               read_unlock(&tasklist_lock);
                rcu_read_unlock();
                err = -ESRCH;
                goto out;
        }
        mm = get_task_mm(task);
-       read_unlock(&tasklist_lock);
        rcu_read_unlock();
 
        err = -EINVAL;