fix: Extend ULLS light mutex range

If some operatioins requires ULLS light stop, execute such operations
under mutex in pair with ULLS stop to ensure no other thread will start
ULLS.

Related-To: NEO-14406, NEO-13922

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-04-07 13:54:45 +00:00
committed by Compute-Runtime-Automation
parent 58faf6e7f5
commit 5bcf500c13
3 changed files with 7 additions and 2 deletions

View File

@@ -348,11 +348,13 @@ int BufferObject::validateHostPtr(BufferObject *const boToPin[], size_t numberOf
}
}
} else {
StackVec<std::unique_lock<NEO::CommandStreamReceiver::MutexType>, 1> locks{};
if (this->drm->getRootDeviceEnvironment().executionEnvironment.memoryManager.get()) {
const auto &engines = this->drm->getRootDeviceEnvironment().executionEnvironment.memoryManager->getRegisteredEngines(osContext->getRootDeviceIndex());
for (const auto &engine : engines) {
if (engine.osContext->isDirectSubmissionLightActive()) {
engine.commandStreamReceiver->stopDirectSubmission(false, true);
locks.push_back(engine.commandStreamReceiver->obtainUniqueOwnership());
engine.commandStreamReceiver->stopDirectSubmission(false, false);
}
}
}

View File

@@ -1367,6 +1367,7 @@ void DrmMemoryManager::freeGraphicsMemoryImpl(GraphicsAllocation *gfxAllocation,
if (engine.osContext->isDirectSubmissionLightActive()) {
lock = engine.commandStreamReceiver->obtainUniqueOwnership();
engine.commandStreamReceiver->stopDirectSubmission(true, false);
handleFenceCompletion(gfxAllocation);
}
auto memoryOperationsInterface = static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get());

View File

@@ -880,12 +880,14 @@ int Drm::waitHandle(uint32_t waitHandle, int64_t timeout) {
wait.boHandle = waitHandle;
wait.timeoutNs = timeout;
StackVec<std::unique_lock<NEO::CommandStreamReceiver::MutexType>, 1> locks{};
if (this->rootDeviceEnvironment.executionEnvironment.memoryManager) {
const auto &mulitEngines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines();
for (const auto &engines : mulitEngines) {
for (const auto &engine : engines) {
if (engine.osContext->isDirectSubmissionLightActive()) {
engine.commandStreamReceiver->stopDirectSubmission(false, true);
locks.push_back(engine.commandStreamReceiver->obtainUniqueOwnership());
engine.commandStreamReceiver->stopDirectSubmission(false, false);
}
}
}