Revert "performance: Optimize heap handling when mitigate dc flush"

This reverts commit 452f4b1dd1.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2024-08-31 05:32:38 +02:00
committed by Compute-Runtime-Automation
parent d7981754fa
commit d3f32358e9
9 changed files with 14 additions and 47 deletions

View File

@@ -47,7 +47,7 @@ bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmReso
} }
GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) { GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) {
if (productHelper.overrideUsageForDcFlushMitigation(allocationType)) { if (productHelper.overridePatAndUsageForDcFlushMitigation(allocationType)) {
return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper); return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper);
} }

View File

@@ -135,9 +135,7 @@ class ProductHelper {
virtual bool isDcFlushAllowed() const = 0; virtual bool isDcFlushAllowed() const = 0;
virtual bool isDcFlushMitigated() const = 0; virtual bool isDcFlushMitigated() const = 0;
virtual bool mitigateDcFlush() const = 0; virtual bool mitigateDcFlush() const = 0;
virtual bool overrideUsageForDcFlushMitigation(AllocationType allocationType) const = 0; virtual bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual bool overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual bool overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0; virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0;
virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0; virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0;
virtual bool getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const = 0; virtual bool getUuid(NEO::DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const = 0;

View File

@@ -416,12 +416,7 @@ bool ProductHelperHw<gfxProduct>::isDcFlushMitigated() const {
} }
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overrideUsageForDcFlushMitigation(AllocationType allocationType) const { bool ProductHelperHw<gfxProduct>::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() && (this->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType) || overridePatToUCAndOneWayCohForDcFlushMitigation(allocationType));
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() && return this->isDcFlushMitigated() &&
(this->overrideCacheableForDcFlushMitigation(allocationType) || (this->overrideCacheableForDcFlushMitigation(allocationType) ||
allocationType == AllocationType::timestampPacketTagBuffer || allocationType == AllocationType::timestampPacketTagBuffer ||
@@ -429,14 +424,6 @@ bool ProductHelperHw<gfxProduct>::overridePatToUCAndTwoWayCohForDcFlushMitigatio
allocationType == AllocationType::gpuTimestampDeviceBuffer); allocationType == AllocationType::gpuTimestampDeviceBuffer);
} }
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() &&
(this->overrideCacheableForDcFlushMitigation(allocationType) ||
allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::linearStream);
}
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const { bool ProductHelperHw<gfxProduct>::overrideCacheableForDcFlushMitigation(AllocationType allocationType) const {
return this->isDcFlushMitigated() && return this->isDcFlushMitigated() &&
@@ -446,6 +433,8 @@ bool ProductHelperHw<gfxProduct>::overrideCacheableForDcFlushMitigation(Allocati
allocationType == AllocationType::svmCpu || allocationType == AllocationType::svmCpu ||
allocationType == AllocationType::svmZeroCopy || allocationType == AllocationType::svmZeroCopy ||
allocationType == AllocationType::internalHostMemory || allocationType == AllocationType::internalHostMemory ||
allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::linearStream ||
allocationType == AllocationType::printfSurface); allocationType == AllocationType::printfSurface);
} }

View File

@@ -77,9 +77,7 @@ class ProductHelperHw : public ProductHelper {
bool isDcFlushAllowed() const override; bool isDcFlushAllowed() const override;
bool isDcFlushMitigated() const override; bool isDcFlushMitigated() const override;
bool mitigateDcFlush() const override; bool mitigateDcFlush() const override;
bool overrideUsageForDcFlushMitigation(AllocationType allocationType) const override; bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const override;
bool overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const override;
bool overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const override;
bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override; bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override;
uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override; uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override;
bool getUuid(NEO::DriverModel *driverModel, uint32_t subDeviceCount, uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const override; bool getUuid(NEO::DriverModel *driverModel, uint32_t subDeviceCount, uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const override;

View File

@@ -28,14 +28,10 @@ int ProductHelperHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, O
template <> template <>
uint64_t ProductHelperHw<gfxProduct>::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const { uint64_t ProductHelperHw<gfxProduct>::overridePatIndex(bool isUncachedType, uint64_t patIndex, AllocationType allocationType) const {
if (this->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)) { if (this->overridePatAndUsageForDcFlushMitigation(allocationType)) {
return 2; // L3: WB, L4: UC, 2-Way coh return 2; // L3: WB, L4: UC, 2-Way coh
} }
if (this->overridePatToUCAndOneWayCohForDcFlushMitigation(allocationType)) {
return 1; // L3: WB, L4: UC, 1-Way coh
}
return patIndex; return patIndex;
} }

View File

@@ -292,17 +292,7 @@ bool ProductHelperHw<IGFX_UNKNOWN>::mitigateDcFlush() const {
} }
template <> template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overridePatToUCAndTwoWayCohForDcFlushMitigation(AllocationType allocationType) const { bool ProductHelperHw<IGFX_UNKNOWN>::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overrideUsageForDcFlushMitigation(AllocationType allocationType) const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overridePatToUCAndOneWayCohForDcFlushMitigation(AllocationType allocationType) const {
return false; return false;
} }

View File

@@ -311,12 +311,12 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw
EXPECT_EQ(AubMemDump::SteppingValues::A, mockProductHelper.getAubStreamSteppingFromHwRevId(pInHwInfo)); EXPECT_EQ(AubMemDump::SteppingValues::A, mockProductHelper.getAubStreamSteppingFromHwRevId(pInHwInfo));
} }
HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatToUCAndTwoWayCohForDcFlushMitigationThenReturnCorrectValue) { HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFlushMitigationThenReturnCorrectValue) {
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;
if (!productHelper->isDcFlushMitigated()) { if (!productHelper->isDcFlushMitigated()) {
for (auto i = 0; i < static_cast<int>(AllocationType::count); ++i) { for (auto i = 0; i < static_cast<int>(AllocationType::count); ++i) {
auto allocationType = static_cast<AllocationType>(i); auto allocationType = static_cast<AllocationType>(i);
EXPECT_FALSE(productHelper->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)); EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));
} }
} }
debugManager.flags.AllowDcFlush.set(0); debugManager.flags.AllowDcFlush.set(0);
@@ -334,9 +334,9 @@ HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatToUCAndTwoWayCo
allocationType == AllocationType::linearStream || allocationType == AllocationType::linearStream ||
allocationType == AllocationType::internalHeap || allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::printfSurface) { allocationType == AllocationType::printfSurface) {
EXPECT_EQ(productHelper->overrideUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated()); EXPECT_EQ(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated());
} else { } else {
EXPECT_FALSE(productHelper->overridePatToUCAndTwoWayCohForDcFlushMitigation(allocationType)); EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));
} }
} }
} }

View File

@@ -146,6 +146,8 @@ LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC
allocationType == AllocationType::svmZeroCopy || allocationType == AllocationType::svmZeroCopy ||
allocationType == AllocationType::internalHostMemory || allocationType == AllocationType::internalHostMemory ||
allocationType == AllocationType::commandBuffer || allocationType == AllocationType::commandBuffer ||
allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::linearStream ||
allocationType == AllocationType::printfSurface) { allocationType == AllocationType::printfSurface) {
EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData));
} else { } else {

View File

@@ -40,8 +40,6 @@ LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledT
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory)); EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer)); EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer)); EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap));
debugManager.flags.AllowDcFlush.set(0); debugManager.flags.AllowDcFlush.set(0);
@@ -53,10 +51,6 @@ LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledT
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory)); EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer)); EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer)); EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer));
expectedPatIndexOverride = 1u;
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap));
} }
LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) { LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) {