mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
fix: Switch copy-engine idle check to try-lock
Related-To: NEO-13325 Replace blocking obtainUniqueOwnership with non-blocking tryObtainUniqueOwnership in isCopyEngineOnDeviceIdle. Treat copy engine as not idle when lock is contended (conservative; prevents false stops). Avoid deadlock scenarios caused by holding directSubmissionsMutex while waiting on a CSR lock. Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e88b4d7b4c
commit
7334aee8a8
@@ -253,7 +253,13 @@ bool DirectSubmissionController::isCopyEngineOnDeviceIdle(uint32_t rootDeviceInd
|
||||
return true;
|
||||
}
|
||||
|
||||
auto lock = bcsCsr->obtainUniqueOwnership();
|
||||
// Non-blocking lock attempt
|
||||
auto lock = bcsCsr->tryObtainUniqueOwnership();
|
||||
if (!lock.owns_lock()) {
|
||||
// Could not acquire -> conservatively declare "not idle"
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bcsCsr->peekTaskCount() == registeredTaskCount) && isDirectSubmissionIdle(bcsCsr, lock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user