]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Fix svm_range_is_same_attrs
authorFelix Kuehling <Felix.Kuehling@amd.com>
Wed, 8 Dec 2021 02:02:42 +0000 (21:02 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Dec 2021 21:32:35 +0000 (16:32 -0500)
commite2cfab18b29d9d7571500f9a080c837af0358819
tree357228bbfde66d0a61ecfb829037936de95bfa07
parent8efddc873aaa9a92b1cfa1ca56ab25848fdea242
drm/amdkfd: Fix svm_range_is_same_attrs

The existing function doesn't compare the access bitmaps and flags.
This can result in failure to update those attributes in existing
ranges when all other attributes remained unchanged.

Because the access and flags attributes modify only some bits in the
respective bitmaps, we cannot compare them directly. Instead we need to
check whether applying the attributes to a particular range would
change the bitmaps.

A PREFETCH_LOC attribute must always trigger a migration, even if the
attribute value remains unchanged. E.g. if some pages were migrated due
to a CPU page fault, a prefetch must still be executed to migrate pages
back to VRAM.

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