feature: enable defer backing by default

Related-To: NEO-13403

Signed-off-by: Bellekallu Rajkiran <bellekallu.rajkiran@intel.com>
Signed-off-by: Narendra Bagria <narendra.bagria@intel.com>
This commit is contained in:
Narendra Bagria
2025-10-27 10:58:45 +00:00
committed by Compute-Runtime-Automation
parent c79877c3ef
commit 19bef4f891
6 changed files with 43 additions and 21 deletions

View File

@@ -1637,6 +1637,7 @@ void *DrmMemoryManager::lockResourceImpl(GraphicsAllocation &graphicsAllocation)
if (ioctlHelper->makeResidentBeforeLockNeeded()) {
auto memoryOperationsInterface = static_cast<DrmMemoryOperationsHandler *>(executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->memoryOperationsInterface.get());
auto graphicsAllocationPtr = &graphicsAllocation;
registerAllocationInOs(graphicsAllocationPtr);
[[maybe_unused]] auto ret = memoryOperationsInterface->makeResidentWithinOsContext(getDefaultOsContext(rootDeviceIndex), ArrayRef<NEO::GraphicsAllocation *>(&graphicsAllocationPtr, 1), false, false, true) == MemoryOperationsStatus::success;
DEBUG_BREAK_IF(!ret);
}

View File

@@ -271,6 +271,11 @@ bool IoctlHelperXe::initialize() {
assignValue(tileIdToMediaGtId, gt.tile_id, gt.gt_id);
}
}
if (debugManager.flags.EnableDeferBacking.get() != -1) {
enableDeferBacking = debugManager.flags.EnableDeferBacking.get();
}
return true;
}
@@ -653,7 +658,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 (debugManager.flags.EnableDeferBacking.get()) {
if (enableDeferBacking) {
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
}
@@ -699,7 +704,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 (debugManager.flags.EnableDeferBacking.get()) {
if (enableDeferBacking) {
create.flags |= DRM_XE_GEM_CREATE_FLAG_DEFER_BACKING;
}
@@ -1816,11 +1821,7 @@ bool IoctlHelperXe::isImmediateVmBindRequired() const {
}
bool IoctlHelperXe::makeResidentBeforeLockNeeded() const {
auto makeResidentBeforeLockNeeded = false;
if (debugManager.flags.EnableDeferBacking.get()) {
makeResidentBeforeLockNeeded = true;
}
return makeResidentBeforeLockNeeded;
return enableDeferBacking;
}
void IoctlHelperXe::insertEngineToContextParams(ContextParamEngines<> &contextParamEngines, uint32_t engineId, const EngineClassInstance *engineClassInstance, uint32_t tileId, bool hasVirtualEngines) {

View File

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