libhsakmt: unmap from GPU error handling
If unmap from GPU return failed, for example, unmap user queue buffer
while queue is active, we should not free obj->mapped_node_id_array,
otherwise, the following unmap user queue buffer after queue is
destroyed still return failed.
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Change-Id: I32aeb18871c2e971d01900d92916c54680f5c9fa
[ROCm/ROCR-Runtime commit: 3e6f51b715]
此提交包含在:
@@ -3339,15 +3339,16 @@ static int _fmm_unmap_from_gpu(manageable_aperture_t *aperture, void *address,
|
||||
args.n_devices * sizeof(uint32_t));
|
||||
ret = hsakmt_ioctl(hsakmt_kfd_fd, AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU, &args);
|
||||
|
||||
remove_device_ids_from_mapped_array(object,
|
||||
(uint32_t *)args.device_ids_array_ptr,
|
||||
args.n_success * sizeof(uint32_t));
|
||||
|
||||
if (object->mapped_node_id_array)
|
||||
free(object->mapped_node_id_array);
|
||||
object->mapped_node_id_array = NULL;
|
||||
object->mapping_count = 0;
|
||||
if (!ret) {
|
||||
remove_device_ids_from_mapped_array(object,
|
||||
(uint32_t *)args.device_ids_array_ptr,
|
||||
args.n_success * sizeof(uint32_t));
|
||||
|
||||
if (object->mapped_node_id_array)
|
||||
free(object->mapped_node_id_array);
|
||||
object->mapped_node_id_array = NULL;
|
||||
object->mapping_count = 0;
|
||||
}
|
||||
out:
|
||||
if (!obj)
|
||||
pthread_mutex_unlock(&aperture->fmm_mutex);
|
||||
|
||||
新增問題並參考
封鎖使用者