Revert "fix: Fix DirectSubmissionController deadlock with try_lock pattern"

Related-To: NEO-13325

This reverts commit 40ce5eb55e.

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
Slawomir Milczarek
2025-10-01 09:27:32 +00:00
committed by Compute-Runtime-Automation
parent 286f973d0c
commit 393c4d0985
2 changed files with 2 additions and 78 deletions

View File

@@ -136,10 +136,7 @@ void DirectSubmissionController::checkNewSubmissions() {
if (!isBcs && csr->getProductHelper().checkBcsForDirectSubmissionStop()) {
isCopyEngineIdle = isCopyEngineOnDeviceIdle(csr->getRootDeviceIndex(), bcsTaskCount);
}
auto lock = csr->tryObtainUniqueOwnership();
if (!lock.owns_lock()) {
continue; // Skip this CSR if contended - avoid deadlock
}
auto lock = csr->obtainUniqueOwnership();
if (!isCsrIdleDetectionEnabled || (isDirectSubmissionIdle(csr, lock) && isCopyEngineIdle)) {
csr->stopDirectSubmission(false, false);
state.isStopped = true;
@@ -209,11 +206,7 @@ bool DirectSubmissionController::isDirectSubmissionIdle(CommandStreamReceiver *c
auto otherKey = ContextGroupKey{otherCsr->getRootDeviceIndex(), otherCsr->getContextGroupId()};
if (otherKey == myKey) {
auto otherLock = otherCsr->tryObtainUniqueOwnership();
if (!otherLock.owns_lock()) {
allOthersIdle = false;
break; // Treat contended CSR as active - avoid deadlock
}
auto otherLock = otherCsr->obtainUniqueOwnership();
if (!checkCSRIdle(otherCsr, otherLock)) {
allOthersIdle = false;
break; // Early exit for performance