edgetpu: use pin_userpages_fast
CMA allocation fails since edgetpu driver holds a referece count
for anonymous pages. To fix it, use pin_user_pages friends which
will migrate the pinned page out of CMA area when the API is
called so CMA area will not have pinned pages so that CMA
allocation will be succeeded.
[ 249.734855][ T2771] page:00000000791d5a0c refcount:2 mapcount:1 mapping:0000000000000000 index:0x76bb2ba pfn:0x9c28d8
[ 249.745238][ T2771] anon flags: 0x8000000000080016(referenced|uptodate|lru|swapbacked)
[ 249.753139][ T2771] raw: 8000000000080016 ffffffff250c5448 ffffffff24eb5148 ffffff8910b9a121
[ 249.761562][ T2771] raw: 00000000076bb2ba 0000000000000000 0000000200000000 ffffff891f6ae000
[ 249.769961][ T2771] page dumped because: fail to isolate
[ 249.775282][ T2771] page->mem_cgroup:ffffff891f6ae000
[ 249.780320][ T2771] page_owner tracks the page as allocated
[ 249.785877][ T2771] page last allocated via order 0, migratetype Movable, gfp_mask 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO)
[ 249.797082][ T2771] prep_new_page+0x54/0x1c4
[ 249.801421][ T2771] get_page_from_freelist+0x278/0x2bc
[ 249.806632][ T2771] __alloc_pages_nodemask+0x140/0x2c0
[ 249.811818][ T2771] do_anonymous_page+0xd0/0x3f0
[ 249.816531][ T2771] handle_pte_fault+0x100/0x29c
[ 249.821220][ T2771] handle_mm_fault+0x1a4/0x2d4
[ 249.825822][ T2771] __get_user_pages+0x178/0x3e4
[ 249.830487][ T2771] get_user_pages_unlocked+0xbc/0x280
[ 249.835694][ T2771] internal_get_user_pages_fast+0x20c/0x2c8
[ 249.841454][ T2771] get_user_pages_fast+0x18/0x30
[ 249.846246][ T2771] edgetpu_pin_user_pages+0x50/0x10c [abrolhos]
[ 249.852314][ T2771] edgetpu_device_group_map+0x4c/0x2c0 [abrolhos]
[ 249.858566][ T2771] edgetpu_ioctl_map_buffer+0x16c/0x2a4 [abrolhos]
[ 249.864905][ T2771] edgetpu_ioctl+0x490/0x864 [abrolhos]
[ 249.870289][ T2771] edgetpu_fs_ioctl+0x2c/0x38 [abrolhos]
Bug: 176462375
Signed-off-by:
Minchan Kim <minchan@google.com>
Change-Id: I57413553b81708ff0e1e25866d0c9643274670f0
Loading
Please sign in to comment