The patch titled Subject: mm-numa-rework-do_pages_move-fix has been added to the -mm tree. Its filename is mm-numa-rework-do_pages_move-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-numa-rework-do_pages_move-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-numa-rework-do_pages_move-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: "Zi Yan" <zi.yan@xxxxxxxxxxxxxx> Subject: mm-numa-rework-do_pages_move-fix I discover that this patch does not hold mmap_sem while migrating pages i= n do_move_pages_to_node(). A simple fix below moves mmap_sem from add_page_for_migration() to the outmost do_pages_move(): Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN mm/migrate.c~mm-numa-rework-do_pages_move-fix mm/migrate.c --- a/mm/migrate.c~mm-numa-rework-do_pages_move-fix +++ a/mm/migrate.c @@ -1486,7 +1486,6 @@ static int add_page_for_migration(struct unsigned int follflags; int err; - down_read(&mm->mmap_sem); err = -EFAULT; vma = find_vma(mm, addr); if (!vma || addr < vma->vm_start || !vma_migratable(vma)) @@ -1541,7 +1540,6 @@ out_putpage: */ put_page(page); out: - up_read(&mm->mmap_sem); return err; } @@ -1562,6 +1560,7 @@ static int do_pages_move(struct mm_struc migrate_prep(); + down_read(&mm->mmap_sem); for (i = start = 0; i < nr_pages; i++) { const void __user *p; unsigned long addr; @@ -1629,6 +1628,7 @@ out_flush: if (!err) err = err1; out: + up_read(&mm->mmap_sem); return err; } _ Patches currently in -mm which might be from zi.yan@xxxxxxxxxxxxxx are mm-numa-rework-do_pages_move-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html