__need_migrate_cma_page() checks a lot of conditions if the current
get_user_pages() request need to migrate CMA pages to some other pages.
But FOLL_CMA is given by very few users. We don't need to spend time
for condition check for the users without FOLL_CMA.
Change-Id: I973b3c99140e71fbf78cb6280e94ef5e97c9824a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
struct vm_area_struct *vma,
unsigned long start, unsigned int flags)
{
- if (!(flags & FOLL_GET))
+ if (!(flags & (FOLL_GET | FOLL_CMA)))
return false;
- if (get_pageblock_migratetype(page) != MIGRATE_CMA)
+ if (!is_migrate_cma_page(page))
return false;
if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) ==
VM_STACK_INCOMPLETE_SETUP)
return false;
- if (!(flags & FOLL_CMA))
- return false;
-
if (!PageLRU(page)) {
migrate_prep_local();
if (WARN_ON(!PageLRU(page))) {