mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
fix: possible race-condition in SvmAllocationCache::insert
Related-To: NEO-15630 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d6a7468246
commit
478c7ce9a8
@@ -66,13 +66,14 @@ bool SVMAllocsManager::SvmAllocationCache::insert(size_t size, void *ptr, SvmAll
|
||||
svmData->isImportedAllocation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(this->mtx);
|
||||
if (svmData->device ? svmData->device->shouldLimitAllocationsReuse() : memoryManager->shouldLimitAllocationsReuse()) {
|
||||
return false;
|
||||
}
|
||||
if (svmData->isSavedForReuse) {
|
||||
return true;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(this->mtx);
|
||||
bool isSuccess = true;
|
||||
if (auto device = svmData->device) {
|
||||
auto lock = device->usmReuseInfo.obtainAllocationsReuseLock();
|
||||
|
||||
Reference in New Issue
Block a user