Revert "feature: enable defer backing by default"

This reverts commit 34d4e526e9.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-09-11 05:18:55 +02:00
committed by Compute-Runtime-Automation
parent d6a713c0e6
commit eba3a2d685
5 changed files with 21 additions and 42 deletions

View File

@@ -498,8 +498,8 @@ DECLARE_DEBUG_VARIABLE(bool, ForceSamplerLowFilteringPrecision, false, "Force Lo
DECLARE_DEBUG_VARIABLE(bool, EnablePrivateBO, false, "Enable PRELIM_I915_GEM_CREATE_EXT_VM_PRIVATE extension creating VM_PRIVATE BOs")
DECLARE_DEBUG_VARIABLE(bool, EnableAIL, true, "Enables AIL")
DECLARE_DEBUG_VARIABLE(bool, EnableReservingInSvmRange, true, "Enables reserving virtual memory in the SVM range")
DECLARE_DEBUG_VARIABLE(bool, EnableDeferBacking, false, "Enables defer backing on xe kmd")
DECLARE_DEBUG_VARIABLE(bool, DisableProgrammableMetricsSupport, false, "Disable Programmable Metrics support")
DECLARE_DEBUG_VARIABLE(int32_t, EnableDeferBacking, -1, "Enables defer backing on xe kmd, -1:default(enabled), 0:disable, 1:enable")
DECLARE_DEBUG_VARIABLE(int64_t, VmBindWaitUserFenceTimeout, -1, "-1: default, >0: time in ns for wait function timeout")
DECLARE_DEBUG_VARIABLE(int32_t, ForceRunAloneContext, -1, "Control creation of run-alone HW context, -1:default, 0:disable, 1:enable")
DECLARE_DEBUG_VARIABLE(int32_t, AddClGlSharing, -1, "Add cl-gl extension")

View File

@@ -268,11 +268,6 @@ bool IoctlHelperXe::initialize() {
assignValue(tileIdToMediaGtId, gt.tile_id, gt.gt_id);
}
}
if (debugManager.flags.EnableDeferBacking.get() != -1) {
enableDeferBacking = debugManager.flags.EnableDeferBacking.get();
}
return true;
}
@@ -655,7 +650,7 @@ int IoctlHelperXe::createGemExt(const MemRegionsVec &memClassInstances, size_t a
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
create.cpu_caching = this->getCpuCachingMode(isCoherent, isSysMemOnly);
if (enableDeferBacking) {
if (debugManager.flags.EnableDeferBacking.get()) {
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
}
@@ -701,7 +696,7 @@ uint32_t IoctlHelperXe::createGem(uint64_t size, uint32_t memoryBanks, std::opti
create.placement = static_cast<uint32_t>(memoryInstances.to_ulong());
create.cpu_caching = this->getCpuCachingMode(isCoherent, isSysMemOnly);
if (enableDeferBacking) {
if (debugManager.flags.EnableDeferBacking.get()) {
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
}
@@ -1658,7 +1653,11 @@ bool IoctlHelperXe::isImmediateVmBindRequired() const {
}
bool IoctlHelperXe::makeResidentBeforeLockNeeded() const {
return enableDeferBacking;
auto makeResidentBeforeLockNeeded = false;
if (debugManager.flags.EnableDeferBacking.get()) {
makeResidentBeforeLockNeeded = true;
}
return makeResidentBeforeLockNeeded;
}
void IoctlHelperXe::insertEngineToContextParams(ContextParamEngines<> &contextParamEngines, uint32_t engineId, const EngineClassInstance *engineClassInstance, uint32_t tileId, bool hasVirtualEngines) {

View File

@@ -227,8 +227,6 @@ class IoctlHelperXe : public IoctlHelper {
};
std::unique_ptr<EuDebugInterface> euDebugInterface;
bool enableDeferBacking = true;
};
template <typename... XeLogArgs>

View File

@@ -647,7 +647,7 @@ EnableTimestampPoolAllocator = -1
PipelinedEuThreadArbitration = -1
ExperimentalUSMAllocationReuseCleaner = -1
DummyPageBackingEnabled = 0
EnableDeferBacking = -1
EnableDeferBacking = 0
ForceLowLatencyHint = -1
EmitMemAdvisePriorToCopyForNonUsm = -1
TreatNonUsmForTransfersAsSharedSystem = -1

View File

@@ -138,6 +138,9 @@ TEST_F(IoctlHelperXeGemCreateExtTests, givenIoctlHelperXeWhenCallingGemCreateExt
}
TEST_F(IoctlHelperXeGemCreateExtTests, givenIoctlHelperXeWhenCallingGemCreateExtWithOnlySystemRegionAndCoherencyThenWriteBackCPUCachingIsUsed) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableDeferBacking.set(1);
MemRegionsVec memRegions = {systemMemory};
bool isCoherent = true;
@@ -146,24 +149,10 @@ TEST_F(IoctlHelperXeGemCreateExtTests, givenIoctlHelperXeWhenCallingGemCreateExt
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING), (drm->createParamsFlags & DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING));
}
TEST_F(IoctlHelperXeGemCreateExtTests, givenIoctlHelperXeAndDeferBackingIsDisabledWhenCallingGemCreateExtThenVerifyGemCreateFlagsAreNotSet) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableDeferBacking.set(0);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
xeIoctlHelper->initialize();
MemRegionsVec memRegions = {systemMemory};
bool isCoherent = true;
EXPECT_NE(0, xeIoctlHelper->createGemExt(memRegions, allocSize, handle, patIndex, std::nullopt, pairHandle, isChunked, numOfChunks, std::nullopt, std::nullopt, isCoherent));
EXPECT_EQ(0u, drm->createParamsFlags);
}
TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndNoLocalMemoryThenProperValuesSet) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableLocalMemory.set(0);
debugManager.flags.EnableDeferBacking.set(0);
debugManager.flags.EnableDeferBacking.set(1);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
@@ -182,7 +171,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndNoLocalMemoryThe
EXPECT_TRUE(xeIoctlHelper->bindInfo.empty());
EXPECT_EQ(size, drm->createParamsSize);
EXPECT_EQ(0u, drm->createParamsFlags);
EXPECT_EQ(static_cast<uint32_t>(DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING), (drm->createParamsFlags & DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING));
EXPECT_EQ(DRM_XE_GEM_CPU_CACHING_WC, drm->createParamsCpuCaching);
EXPECT_EQ(1u, drm->createParamsPlacement);
@@ -194,6 +183,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndNoLocalMemoryThe
TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateWhenMemoryBanksZeroThenProperValuesSet) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableLocalMemory.set(0);
debugManager.flags.EnableDeferBacking.set(1);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
@@ -224,6 +214,7 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateWhenMemoryBanksZero
TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallGemCreateAndLocalMemoryThenProperValuesSet) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableLocalMemory.set(1);
debugManager.flags.EnableDeferBacking.set(1);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
@@ -3016,22 +3007,13 @@ TEST_F(IoctlHelperXeTest, whenQueryDeviceIdAndRevisionAndSharedSystemUsmSupportD
EXPECT_FALSE(drm->isSharedSystemAllocEnabled());
}
TEST_F(IoctlHelperXeTest, givenXeIoctlHelperWhenMakeResidentBeforeLockNeededIsCalledThenVerifyTrueIsReturned) {
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
xeIoctlHelper->initialize();
EXPECT_TRUE(xeIoctlHelper->makeResidentBeforeLockNeeded());
}
TEST_F(IoctlHelperXeTest, givenXeIoctlHelperAndDeferBackingFlagSetToFalseWhenMakeResidentBeforeLockNeededIsCalledThenVerifyTrueIsReturned) {
TEST_F(IoctlHelperXeTest, givenXeIoctlHelperAndDeferBackingFlagSetToTrueWhenMakeResidentBeforeLockNeededIsCalledThenVerifyTrueIsReturned) {
DebugManagerStateRestore restorer;
debugManager.flags.EnableDeferBacking.set(0);
debugManager.flags.EnableDeferBacking.set(1);
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
xeIoctlHelper->initialize();
EXPECT_FALSE(xeIoctlHelper->makeResidentBeforeLockNeeded());
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
auto xeIoctlHelper = std::make_unique<IoctlHelperXe>(drm);
EXPECT_TRUE(xeIoctlHelper->makeResidentBeforeLockNeeded());
}
TEST_F(IoctlHelperXeTest, givenXeIoctlHelperWhenCreateDrmContextAndLowLatencyHintNotAvailableThenNoFlagIsSet) {