]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdkfd: add function svm_migrate_successful_pages
authorJames Zhu <James.Zhu@amd.com>
Fri, 22 Aug 2025 19:38:01 +0000 (15:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Sep 2025 21:03:44 +0000 (17:03 -0400)
commita450d225327845c9e780d81ec881c8813bbf1f7b
treef44c5c550c4dbead184a610541487081843df294
parent7ccaaf13197fddb525571d6646bc174405efb37c
drm/amdkfd: add function svm_migrate_successful_pages

to get migration pages. dst MIGRATE_PFN_VALID bit and src
MIGRATE_PFN_MIGRATE bit should always be set when migration success.

cpage includes src MIGRATE_PFN_MIGRATE bit set and MIGRATE_PFN_VALID
bit unset pages for both RAM and VRAM when memory is only allocated
without being populated before migration, those ram pages should be
counted as migrated pages and those vram pages should not be counted
as migrated pages. Here migration pages refer to how many vram pages
invloved. Current svm_migrate_unsuccessful_pages only covers the
unsuccessful case that source is on RAM.

So far, we only see two unsuccessful migration cases. Since we
can clearly identify successful migration cases through dst
MIGRATE_PFN_VALID bit and src MIGRATE_PFN_MIGRATE bit within this
prange, also eventually successful migration pages will be used,
so we can use function svm_migrate_successful_pages to replace
function svm_migrate_unsuccessful_pages.

Signed-off-by: James Zhu <James.Zhu@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_migrate.c