mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
fix: use condition variables instead of busy waits in worker threads
Resolves: NEO-16085, GSD-11678, HSD-14025819208 Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
49293fcac6
commit
452475a0b9
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_stream/queue_throttle.h"
|
||||
#include "shared/source/command_stream/task_count_helper.h"
|
||||
#include "shared/source/helpers/device_bitfield.h"
|
||||
#include "shared/source/helpers/sleep.h"
|
||||
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
@@ -95,10 +96,11 @@ class DirectSubmissionController {
|
||||
};
|
||||
|
||||
static void *controlDirectSubmissionsState(void *self);
|
||||
void checkNewSubmissions();
|
||||
MOCKABLE_VIRTUAL void checkNewSubmissions();
|
||||
bool isDirectSubmissionIdle(CommandStreamReceiver *csr, std::unique_lock<std::recursive_mutex> &csrLock);
|
||||
bool isCopyEngineOnDeviceIdle(uint32_t rootDeviceIndex, std::optional<TaskCountType> &bcsTaskCount);
|
||||
MOCKABLE_VIRTUAL bool sleep(std::unique_lock<std::mutex> &lock);
|
||||
MOCKABLE_VIRTUAL bool hasNoWork();
|
||||
MOCKABLE_VIRTUAL SteadyClock::time_point getCpuTimestamp();
|
||||
MOCKABLE_VIRTUAL void overrideDirectSubmissionTimeouts(const ProductHelper &productHelper);
|
||||
|
||||
@@ -107,7 +109,7 @@ class DirectSubmissionController {
|
||||
void updateLastSubmittedThrottle(QueueThrottle throttle);
|
||||
size_t getTimeoutParamsMapKey(QueueThrottle throttle, bool acLineStatus);
|
||||
|
||||
void handlePagingFenceRequests(std::unique_lock<std::mutex> &lock, bool checkForNewSubmissions);
|
||||
MOCKABLE_VIRTUAL void handlePagingFenceRequests(std::unique_lock<std::mutex> &lock, bool checkForNewSubmissions);
|
||||
MOCKABLE_VIRTUAL TimeoutElapsedMode timeoutElapsed();
|
||||
std::chrono::microseconds getSleepValue() const { return std::chrono::microseconds(this->timeout / this->bcsTimeoutDivisor); }
|
||||
|
||||
@@ -131,8 +133,7 @@ class DirectSubmissionController {
|
||||
bool isCsrIdleDetectionEnabled = false;
|
||||
bool isCsrsContextGroupIdleDetectionEnabled = false;
|
||||
|
||||
std::condition_variable condVar;
|
||||
std::mutex condVarMutex;
|
||||
ConditionVarSyncData syncData;
|
||||
|
||||
std::queue<WaitForPagingFenceRequest> pagingFenceRequests;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user