fix: Switch compute-engine idle check to try-lock

Related-To: NEO-13225

Replace blocking obtainUniqueOwnership with non-blocking
tryObtainUniqueOwnership in isDirectSubmissionIdle.
Treat compute 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-10-02 12:41:06 +00:00
committed by Compute-Runtime-Automation
parent 5110a405a1
commit 98b6259129
2 changed files with 86 additions and 1 deletions

View File

@@ -206,7 +206,11 @@ bool DirectSubmissionController::isDirectSubmissionIdle(CommandStreamReceiver *c
auto otherKey = ContextGroupKey{otherCsr->getRootDeviceIndex(), otherCsr->getContextGroupId()};
if (otherKey == myKey) {
auto otherLock = otherCsr->obtainUniqueOwnership();
auto otherLock = otherCsr->tryObtainUniqueOwnership();
if (!otherLock.owns_lock()) {
allOthersIdle = false;
break; // Treat contended CSR as active (non-idle)
}
if (!checkCSRIdle(otherCsr, otherLock)) {
allOthersIdle = false;
break; // Early exit for performance