]> 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)
commit13ade06fbd209868df5678f00763d99bf644bc07
tree9d24fd8ae33382963d8f2afbcb9f7d31320d58db
parentdfef0ed67bfcfe14ff821fc41f0e1db515a8d6ec
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