Revert "feature: enable defer backing by default"

This reverts commit 94a857b975.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-12-03 01:04:41 +01:00
committed by Compute-Runtime-Automation
parent f60868c2bb
commit 936de45c71
6 changed files with 20 additions and 41 deletions

View File

@@ -509,10 +509,10 @@ 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(bool, Enable512NumGrfs, true, "Enable support for 512 of GRFs per thread")
DECLARE_DEBUG_VARIABLE(int64_t, VmBindWaitUserFenceTimeout, -1, "-1: default, >0: time in ns for wait function timeout")
DECLARE_DEBUG_VARIABLE(int32_t, EnableDeferBacking, -1, "Enables defer backing on xe kmd, -1:default(enabled), 0:disable, 1:enable")
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")
DECLARE_DEBUG_VARIABLE(int32_t, EnableBOMmapCreate, -1, "Create BOs using mmap, -1:default, 0:disable(GEM_USERPTR), 1:enable")

View File

@@ -1685,7 +1685,6 @@ void DrmMemoryManager::makeAllocationResidentIfNeeded(GraphicsAllocation *alloca
auto ioctlHelper = this->getDrm(rootDeviceIndex).getIoctlHelper();
if (ioctlHelper->makeResidentBeforeLockNeeded()) {
auto memoryOperationsInterface = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get();
registerAllocationInOs(allocation);
[[maybe_unused]] auto ret = memoryOperationsInterface->makeResidentWithinOsContext(getDefaultOsContext(rootDeviceIndex), ArrayRef<NEO::GraphicsAllocation *>(&allocation, 1), false, false, true) == MemoryOperationsStatus::success;
DEBUG_BREAK_IF(!ret);
}

View File

@@ -271,10 +271,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;
}
@@ -657,7 +653,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;
}
@@ -1858,7 +1854,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

@@ -233,7 +233,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());
@@ -3479,23 +3470,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) {