fix: drain paging fence queue before waiting for resources

Related-To: NEO-12197

If ULLS controller waits for CSR lock, and driver must
wait for resources due to OOM, then draing paging fence queue
directly

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-08-29 15:38:06 +00:00
committed by Compute-Runtime-Automation
parent 9559445e7f
commit e6abfafa16
9 changed files with 86 additions and 1 deletions

View File

@@ -208,6 +208,16 @@ void DirectSubmissionController::enqueueWaitForPagingFence(CommandStreamReceiver
condVar.notify_one();
}
void DirectSubmissionController::drainPagingFenceQueue() {
std::lock_guard lock(this->condVarMutex);
while (!pagingFenceRequests.empty()) {
auto request = pagingFenceRequests.front();
pagingFenceRequests.pop();
request.csr->unblockPagingFenceSemaphore(request.pagingFenceValue);
}
}
void DirectSubmissionController::handlePagingFenceRequests(std::unique_lock<std::mutex> &lock, bool checkForNewSubmissions) {
UNRECOVERABLE_IF(!lock.owns_lock())
while (!pagingFenceRequests.empty()) {

View File

@@ -57,6 +57,7 @@ class DirectSubmissionController {
static bool isSupported();
void enqueueWaitForPagingFence(CommandStreamReceiver *csr, uint64_t pagingFenceValue);
void drainPagingFenceQueue();
protected:
struct DirectSubmissionState {