Fix unconditional unmap in fmm_map_to_gpu_nodes
_fmm_unmap_from_gpu is called in fmm_map_to_gpu_nodes to unmap buffer from nodes that is already mapped to but not in the new map nodes list. Previously, the unmap was called unconditionally even though the size of the array to unmap is 0. This fixes the issue by calling the unmap func only when the unmap array size is not 0. Also releases the fmm_mutex on error returns Change-Id: Iadd8383caf7ebb92f02618798c5efd138a352aaa Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Ta zmiana jest zawarta w:
%! (template.HTML=
Oak Zeng)złożyło 2017-11-21 15:16:39 -05:00
1 rodzic
f06e887725
złożenie
061db45fe2
Plik 1 zmieniony
+10
-5
+10
-5
@@ -3022,11 +3022,16 @@ HSAKMT_STATUS fmm_map_to_gpu_nodes(void *address, uint64_t size,
|
||||
}
|
||||
temp_node_id_array_size *= sizeof(uint32_t);
|
||||
|
||||
ret = _fmm_unmap_from_gpu(aperture, address,
|
||||
temp_node_id_array, temp_node_id_array_size,
|
||||
object);
|
||||
if (ret != HSAKMT_STATUS_SUCCESS)
|
||||
return ret;
|
||||
if (temp_node_id_array_size) {
|
||||
ret = _fmm_unmap_from_gpu(aperture, address,
|
||||
temp_node_id_array,
|
||||
temp_node_id_array_size,
|
||||
object);
|
||||
if (ret != HSAKMT_STATUS_SUCCESS) {
|
||||
pthread_mutex_unlock(&aperture->fmm_mutex);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
retcode = _fmm_map_to_gpu_gtt(aperture, address, size, object,
|
||||
|
||||
Reference in new issue
Zablokuj użytkownika