mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
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:
committed by
Compute-Runtime-Automation
parent
5110a405a1
commit
98b6259129
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user