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:
Igor Venevtsev
2025-09-23 12:24:40 +00:00
committed by Compute-Runtime-Automation
parent 49293fcac6
commit 452475a0b9
18 changed files with 218 additions and 67 deletions

View File

@@ -68,6 +68,7 @@ class ProductHelper;
class ReleaseHelper;
enum class WaitStatus;
struct AubSubCaptureStatus;
struct ConditionVarSyncData;
template <typename TSize, uint32_t packetCount>
class TimestampPackets;
@@ -569,6 +570,8 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
HostFunctionData &getHostFunctionData();
GraphicsAllocation *getHostFunctionDataAllocation();
void setDirectSubmissionControllerSyncData(ConditionVarSyncData *syncData) { directSubmissionControllerSyncData = syncData; }
protected:
MOCKABLE_VIRTUAL void initializeHostFunctionData();
@@ -588,6 +591,8 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
void downloadTagAllocation(TaskCountType taskCountToWait);
void printTagAddressContent(TaskCountType taskCountToWait, int64_t waitTimeout, bool start);
virtual void addToEvictionContainer(GraphicsAllocation &gfxAllocation);
void incrementTaskCountAndNotifyNewSubmission();
void notifyNewSubmission();
[[nodiscard]] MOCKABLE_VIRTUAL std::unique_lock<MutexType> obtainHostPtrSurfaceCreationLock();
@@ -652,6 +657,8 @@ class CommandStreamReceiver : NEO::NonCopyableAndNonMovableClass {
TaskCountType *completionFenceValuePointer = nullptr;
HostFunctionData hostFunctionData;
ConditionVarSyncData *directSubmissionControllerSyncData = nullptr;
std::atomic<TaskCountType> barrierCount{0};
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.
std::atomic<TaskCountType> taskLevel{0};