]> Gentwo Git Trees - linux/.git/commit
drm/amdkfd: return migration pages from copy function
authorJames Zhu <James.Zhu@amd.com>
Wed, 28 May 2025 16:38:58 +0000 (12:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Aug 2025 18:19:12 +0000 (14:19 -0400)
commitbd6093e2f1601c0c83906f5115a2efb6b93050b1
tree0d3bdb1927aff3e6182e56b6b483eb8b77a1d1ce
parent5c15a05b52553ad99c68a661b832aff3eeb2a7b7
drm/amdkfd: return migration pages from copy function

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 migrate pages and those vram pages should not be
counted as migrate pages. Here migration pages refer to how many
vram pages involved.

-v2 use dst to check MIGRATE_PFN_VALID bit (suggested-by Philip)
-v3 add warning when vram pages is less than migration pages
    return migration pages directly from copy function
-v4 correct comments and copy function return mpage (suggested-by Felix)

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c