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:
Slawomir Milczarek
2025-09-29 14:17:38 +00:00
committed by Compute-Runtime-Automation
parent e88b4d7b4c
commit 7334aee8a8
3 changed files with 56 additions and 1 deletions

View File

@@ -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);
}