[COMMON] mm: gup: fix invalid comparison for CMA
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 27 Dec 2016 11:33:02 +0000 (20:33 +0900)
committerhskang <hs1218.kang@samsung.com>
Mon, 27 Aug 2018 07:21:35 +0000 (16:21 +0900)
CMA pages should not be pinned for a long time because they should be
always ready for reclamation by the user's request. If a user of gup
wants to pin a series of pages for a long time he/she should give
FOLL_CMA to let gup migrate the CMA pages that are in pinning to
non-CMA pages.

In order to determine if a pinning page is in a CMA page, gpu should
compare if the migrate type of the pageblock of the page is
MIGRATE_CMA. But the comparison is not correct and the migration
never happens.

SVACE #82317

Change-Id: Id4ef40957365bdbe586f29c4ba0e6318e232719a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
mm/gup.c

index 9877d3887884e650e741335cb79f93c05934b1f3..b7183fd5a7770d2e8015f294f2c78a23fa49071b 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -39,7 +39,7 @@ static bool __need_migrate_cma_page(struct page *page,
        if (!(flags & FOLL_GET))
                return false;
 
-       if (!get_pageblock_migratetype(page) != MIGRATE_CMA)
+       if (get_pageblock_migratetype(page) != MIGRATE_CMA)
                return false;
 
        if ((vma->vm_flags & VM_STACK_INCOMPLETE_SETUP) ==