OSDN Git Service

drm/amdkfd: Fixed kfd_process cleanup on module exit.
authorDavid Belanger <david.belanger@amd.com>
Tue, 28 Feb 2023 19:11:24 +0000 (14:11 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Mar 2023 22:21:05 +0000 (18:21 -0400)
commit20bc9f76b6a2455c6b54b91ae7634f147f64987f
tree9a730dc93eb72067d8a2803b691fefbf8d9511e8
parent7304ee979b6b6422f41a1312391a5e505fc29ccd
drm/amdkfd: Fixed kfd_process cleanup on module exit.

Handle case when module is unloaded (kfd_exit) before a process space
(mm_struct) is released.

v2: Fixed potential race conditions by removing all kfd_process from
the process table first, then working on releasing the resources.

v3: Fixed loop element access / synchronization.  Fixed extra empty lines.

Signed-off-by: David Belanger <david.belanger@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_module.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_process.c