Message ID | 20201104024024.gT0sT%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | [alternative-merged] mm-gup-use-unpin_user_pages-in-check_and_migrate_cma_pages.patch removed from -mm tree | expand |
--- a/mm/gup.c~mm-gup-use-unpin_user_pages-in-check_and_migrate_cma_pages +++ a/mm/gup.c @@ -1647,8 +1647,11 @@ check_again: /* * drop the above get_user_pages reference. */ - for (i = 0; i < nr_pages; i++) - put_page(pages[i]); + if (gup_flags & FOLL_PIN) + unpin_user_pages(pages, nr_pages); + else + for (i = 0; i < nr_pages; i++) + put_page(pages[i]); if (migrate_pages(&cma_page_list, alloc_migration_target, NULL, (unsigned long)&mtc, MIGRATE_SYNC, MR_CONTIG_RANGE)) {