]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: support userptr cross VMAs case with HMM
authorPhilip Yang <Philip.Yang@amd.com>
Mon, 4 Mar 2019 19:41:03 +0000 (14:41 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:02 +0000 (12:21 -0500)
commitf9fcefc4d590b3930a32beb3dfdadca605e9a430
tree9d24fd8ae33382963d8f2afbcb9f7d31320d58db
parent2f7628081399c7e05453fbeae265b820601e1ea0
drm/amdgpu: support userptr cross VMAs case with HMM

userptr may cross two VMAs if the forked child process (not call exec
after fork) malloc buffer, then free it, and then malloc larger size
buf, kerenl will create new VMA adjacent to old VMA which was cloned
from parent process, some pages of userptr are in the first VMA, the
rest pages are in the second VMA.

HMM expects range only have one VMA, loop over all VMAs in the address
range, create multiple ranges to handle this case. See
is_mergeable_anon_vma in mm/mmap.c for details.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c