mali_kbase: fix longtime page pinning for CMA area
I found mali could pin pages on the CMA area via using
get_user_pages_remote for a long time(at least, several
hours because I am still seeing after last sleep. I have
no idea when it started and will be done).
Thing is it could break the CMA allocation because VM
couldn't migrate the memory. Technically, driver should
use pin_user_pages_remote(since v5.7) instead of
get_user_pages_remote.
This patch changes the API with pin_user_pages_remote and
unpin_user_page if the kernel version is greater than
5.9.0.
try_grab_page+0x148/0x1a8
follow_page_pte+0x2b4/0x4a8
follow_pmd_mask+0x180/0x478
__get_user_pages+0x1a0/0x434
__get_user_pages_remote+0xa4/0x28c
get_user_pages_remote+0x20/0x48
kbase_jd_user_buf_pin_pages+0x94/0x158 [mali_kbase]
kbase_jd_user_buf_map+0x34/0x220 [mali_kbase]
kbase_map_external_resource+0x68/0xf8 [mali_kbase]
jd_submit_atom+0x538/0x878 [mali_kbase]
kbase_jd_submit+0xe0/0x3c4 [mali_kbase]
kbase_ioctl+0x354/0x1158 [mali_kbase]
__arm64_sys_ioctl+0x94/0xd0
el0_svc_common+0xa4/0x180
Bug: 183641831
Signed-off-by:
Minchan Kim <minchan@google.com>
Change-Id: Iab6837a2e184c43a9387d85ad562975e0881c10f
Loading