performance: Adjust waitpkg threshold for discrete devices

Related-To: NEO-14336

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-03-26 12:53:38 +00:00
committed by Compute-Runtime-Automation
parent a89113fa1a
commit 60b551758c
7 changed files with 45 additions and 34 deletions

View File

@@ -1442,7 +1442,7 @@ inline bool CommandStreamReceiverHw<GfxFamily>::initDirectSubmission() {
this->osContext->setDirectSubmissionActive();
if (this->osContext->isDirectSubmissionLightActive()) {
this->pushAllocationsForMakeResident = false;
WaitUtils::init(WaitUtils::WaitpkgUse::tpause);
WaitUtils::init(WaitUtils::WaitpkgUse::tpause, *this->peekExecutionEnvironment().rootDeviceEnvironments[this->getRootDeviceIndex()]->getHardwareInfo());
}
}
}

View File

@@ -26,11 +26,9 @@
#include "shared/source/os_interface/os_environment.h"
#include "shared/source/os_interface/os_interface.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/utilities/wait_util.h"
namespace NEO {
ExecutionEnvironment::ExecutionEnvironment() {
WaitUtils::init(WaitUtils::WaitpkgUse::tpause);
this->configureNeoEnvironment();
}

View File

@@ -36,6 +36,7 @@
#include "shared/source/release_helper/release_helper.h"
#include "shared/source/sip_external_lib/sip_external_lib.h"
#include "shared/source/utilities/software_tags_manager.h"
#include "shared/source/utilities/wait_util.h"
namespace NEO {
@@ -85,6 +86,8 @@ void RootDeviceEnvironment::setHwInfo(const HardwareInfo *hwInfo) {
if (debugManager.flags.DisableSupportForL0Debugger.get() == 1) {
this->hwInfo->capabilityTable.l0DebuggerSupported = false;
}
WaitUtils::init(WaitUtils::WaitpkgUse::tpause, *hwInfo);
}
bool RootDeviceEnvironment::isFullRangeSvm() const {

View File

@@ -8,6 +8,7 @@
#include "shared/source/utilities/wait_util.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/utilities/cpu_info.h"
namespace NEO {
@@ -27,7 +28,7 @@ bool waitpkgSupport = SUPPORTS_WAITPKG;
bool waitpkgSupport = false;
#endif
void init(WaitpkgUse inputWaitpkgUse) {
void init(WaitpkgUse inputWaitpkgUse, const HardwareInfo &hwInfo) {
if (debugManager.flags.WaitLoopCount.get() != -1) {
waitCount = debugManager.flags.WaitLoopCount.get();
}
@@ -47,6 +48,10 @@ void init(WaitpkgUse inputWaitpkgUse) {
waitpkgUse = inputWaitpkgUse;
if (!hwInfo.capabilityTable.isIntegratedDevice) {
waitPkgThresholdInMicroSeconds = WaitUtils::defaultWaitPkgThresholdForDiscreteInMicroSeconds;
}
if (waitpkgUse == WaitpkgUse::umonitorAndUmwait) {
waitCount = 0u;
}

View File

@@ -15,6 +15,8 @@
namespace NEO {
struct HardwareInfo;
namespace WaitUtils {
enum class WaitpkgUse : int32_t {
@@ -25,6 +27,7 @@ enum class WaitpkgUse : int32_t {
};
constexpr int64_t defaultWaitPkgThresholdInMicroSeconds = 12;
constexpr int64_t defaultWaitPkgThresholdForDiscreteInMicroSeconds = 28;
constexpr uint64_t defaultCounterValue = 16000;
constexpr uint32_t defaultControlValue = 0;
constexpr uint32_t defaultWaitCount = 1u;
@@ -77,7 +80,7 @@ inline bool waitFunction(volatile TagAddressType *pollAddress, TaskCountType exp
return waitFunctionWithPredicate<TaskCountType>(pollAddress, expectedValue, std::greater_equal<TaskCountType>(), timeElapsedSinceWaitStarted);
}
void init(WaitpkgUse inputWaitpkgUse);
void init(WaitpkgUse inputWaitpkgUse, const HardwareInfo &hwInfo);
} // namespace WaitUtils
} // namespace NEO