Skip to content

Commit 590418a

Browse files
Revert "performance: Limit tlb flush WA scope on DG2 Linux"
This reverts commit 0b85a9f. Signed-off-by: Compute-Runtime-Validation <[email protected]>
1 parent 2d62c4e commit 590418a

File tree

16 files changed

+15
-67
lines changed

16 files changed

+15
-67
lines changed

shared/source/os_interface/linux/drm_buffer_object.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "shared/source/command_stream/task_count_helper.h"
1111
#include "shared/source/helpers/common_types.h"
1212
#include "shared/source/helpers/constants.h"
13-
#include "shared/source/memory_manager/allocation_type.h"
1413
#include "shared/source/memory_manager/definitions/engine_limits.h"
1514
#include "shared/source/memory_manager/memory_operations_status.h"
1615
#include "shared/source/os_interface/linux/cache_info.h"
@@ -214,14 +213,6 @@ class BufferObject {
214213

215214
bool isChunked = false;
216215

217-
void setIsImage(AllocationType type) {
218-
this->isImageAllocation = type == AllocationType::image;
219-
}
220-
221-
bool isImage() const {
222-
return this->isImageAllocation;
223-
}
224-
225216
protected:
226217
MOCKABLE_VIRTUAL MemoryOperationsStatus evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded);
227218

@@ -239,7 +230,6 @@ class BufferObject {
239230
bool allowCapture = false;
240231
bool requiresImmediateBinding = false;
241232
bool requiresExplicitResidency = false;
242-
bool isImageAllocation = false;
243233

244234
MOCKABLE_VIRTUAL void fillExecObject(ExecObject &execObject, OsContext *osContext, uint32_t vmHandleId, uint32_t drmContextId);
245235
void printBOBindingResult(OsContext *osContext, uint32_t vmHandleId, bool bind, int retVal);

shared/source/os_interface/linux/drm_memory_manager.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A
678678
return nullptr;
679679
}
680680
bo->setAddress(gpuRange);
681-
bo->setIsImage(allocationData.type);
682681

683682
[[maybe_unused]] auto ret2 = bo->setTiling(ioctlHelper->getDrmParamValue(DrmParam::tilingY), static_cast<uint32_t>(allocationData.imgInfo->rowPitch));
684683
DEBUG_BREAK_IF(ret2 != true);
@@ -1068,7 +1067,6 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
10681067
drmAllocation->setDefaultGmm(gmm);
10691068

10701069
bo->setPatIndex(drm.getPatIndex(gmm, properties.allocationType, CacheRegion::defaultRegion, CachePolicy::writeBack, false, MemoryPoolHelper::isSystemMemoryPool(memoryPool)));
1071-
bo->setIsImage(properties.allocationType);
10721070
}
10731071

10741072
if (!reuseSharedAllocation) {
@@ -1899,7 +1897,6 @@ BufferObject *DrmMemoryManager::createBufferObjectInMemoryRegion(uint32_t rootDe
18991897
}
19001898

19011899
bo->setAddress(gpuAddress);
1902-
bo->setIsImage(allocationType);
19031900

19041901
return bo;
19051902
}

shared/source/os_interface/linux/drm_neo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) const {
688688
}
689689

690690
void Drm::setNewResourceBoundToVM(BufferObject *bo, uint32_t vmHandleId) {
691-
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired(*this->getHardwareInfo(), bo->isImage())) {
691+
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired()) {
692692
return;
693693
}
694694
const auto &engines = this->rootDeviceEnvironment.executionEnvironment.memoryManager->getRegisteredEngines(bo->getRootDeviceIndex());

shared/source/os_interface/product_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class ProductHelper {
159159
virtual bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const = 0;
160160
virtual bool isMidThreadPreemptionDisallowedForRayTracingKernels() const = 0;
161161
virtual bool isBufferPoolAllocatorSupported() const = 0;
162-
virtual bool isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const = 0;
162+
virtual bool isTlbFlushRequired() const = 0;
163163
virtual bool isDummyBlitWaRequired() const = 0;
164164
virtual bool isDetectIndirectAccessInKernelSupported(const KernelDescriptor &kernelDescriptor, const bool isPrecompiled) const = 0;
165165
virtual bool isLinearStoragePreferred(bool isImage1d, bool forceLinearStorage) const = 0;

shared/source/os_interface/product_helper.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const Hardwa
6161
}
6262

6363
template <PRODUCT_FAMILY gfxProduct>
64-
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const {
64+
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
6565
bool tlbFlushRequired = true;
6666
if (debugManager.flags.ForceTlbFlush.get() != -1) {
6767
tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get();

shared/source/os_interface/product_helper_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ProductHelperHw : public ProductHelper {
112112
bool isResolveDependenciesByPipeControlsSupported(const HardwareInfo &hwInfo, bool isOOQ, TaskCountType queueTaskCount, const CommandStreamReceiver &queueCsr) const override;
113113
bool isMidThreadPreemptionDisallowedForRayTracingKernels() const override;
114114
bool isBufferPoolAllocatorSupported() const override;
115-
bool isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const override;
115+
bool isTlbFlushRequired() const override;
116116
bool isDummyBlitWaRequired() const override;
117117
bool isDetectIndirectAccessInKernelSupported(const KernelDescriptor &kernelDescriptor, const bool isPrecompiled) const override;
118118
bool isLinearStoragePreferred(bool isImage1d, bool forceLinearStorage) const override;

shared/source/os_interface/windows/wddm/wddm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,7 @@ void Wddm::populateIpVersion(HardwareInfo &hwInfo) {
13491349
}
13501350

13511351
void Wddm::setNewResourceBoundToPageTable() {
1352-
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired(*this->getHardwareInfo(), true)) {
1352+
if (!this->rootDeviceEnvironment.getProductHelper().isTlbFlushRequired()) {
13531353
return;
13541354
}
13551355
this->forEachContextWithinWddm([](const EngineControl &engine) { engine.osContext->setNewResourceBound(); });

shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool ProductHelperHw<gfxProduct>::isBlitCopyRequiredForLocalMemory(const RootDev
138138
}
139139

140140
template <>
141-
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const {
141+
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired() const {
142142
bool tlbFlushRequired = false;
143143
if (debugManager.flags.ForceTlbFlush.get() != -1) {
144144
tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get();

shared/source/xe_hpg_core/linux/product_helper_dg2.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,6 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
4646
return 0;
4747
}
4848

49-
template <>
50-
bool ProductHelperHw<gfxProduct>::isTlbFlushRequired(const HardwareInfo &hwInfo, bool precondition) const {
51-
bool tlbFlushRequired = !DG2::isG10(hwInfo) && precondition;
52-
if (debugManager.flags.ForceTlbFlush.get() != -1) {
53-
tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get();
54-
}
55-
return tlbFlushRequired;
56-
}
57-
5849
template <>
5950
bool ProductHelperHw<gfxProduct>::getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const {
6051
if (driverModel->getDriverModelType() != DriverModelType::drm) {

shared/test/unit_test/os_interface/linux/drm_buffer_object_tests.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,6 @@ TEST_F(DrmBufferObjectTest, whenExecFailsThenValidateHostPtrFails) {
140140
EXPECT_EQ(EINVAL, ret);
141141
}
142142

143-
TEST_F(DrmBufferObjectTest, whenSetImageAllocTypeForBOThenReturnProperValue) {
144-
TestedBufferObject bo(0u, this->mock.get());
145-
EXPECT_FALSE(bo.isImage());
146-
bo.setIsImage(AllocationType::kernelIsa);
147-
EXPECT_FALSE(bo.isImage());
148-
bo.setIsImage(AllocationType::image);
149-
EXPECT_TRUE(bo.isImage());
150-
}
151-
152143
TEST_F(DrmBufferObjectTest, givenResidentBOWhenPrintExecutionBufferIsSetToTrueThenDebugInformationAboutBOIsPrinted) {
153144
mock->ioctlExpected.total = 1;
154145
DebugManagerStateRestore restore;

0 commit comments

Comments
 (0)