From 45a26c22dd99769e54ddac26864806363c5acddb Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Wed, 30 Oct 2024 22:11:42 +0100 Subject: [PATCH] Revert "performance: limit tlb flush scope to DG2" This reverts commit 10d123ae3e95623ec6a889d530113789f6071ba8. Signed-off-by: Compute-Runtime-Validation --- shared/source/os_interface/product_helper.inl | 2 +- .../xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl | 9 +++++++++ .../xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl | 9 --------- .../unit_test/os_interface/product_helper_tests.cpp | 10 +++++----- .../xe_hpc_core/pvc/test_product_helper_pvc.cpp | 4 ++++ .../mtl/windows/product_helper_tests_mtl_windows.cpp | 4 ++++ 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 1ef697c227..dbc690fea4 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -63,7 +63,7 @@ void ProductHelperHw::adjustSamplerState(void *sampler, const Hardwa template bool ProductHelperHw::isTlbFlushRequired() const { - bool tlbFlushRequired = false; + bool tlbFlushRequired = true; if (debugManager.flags.ForceTlbFlush.get() != -1) { tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); } diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl index fb34534c72..a23798cb48 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl @@ -148,6 +148,15 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev return false; } +template <> +bool ProductHelperHw::isTlbFlushRequired() const { + bool tlbFlushRequired = false; + if (debugManager.flags.ForceTlbFlush.get() != -1) { + tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); + } + return tlbFlushRequired; +} + template <> bool ProductHelperHw::isBlitSplitEnqueueWARequired(const HardwareInfo &hwInfo) const { return true; diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl index aef3666a8c..37f2bd10b3 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl @@ -266,13 +266,4 @@ bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { return true; } -template <> -bool ProductHelperHw::isTlbFlushRequired() const { - bool tlbFlushRequired = true; - if (debugManager.flags.ForceTlbFlush.get() != -1) { - tlbFlushRequired = !!debugManager.flags.ForceTlbFlush.get(); - } - return tlbFlushRequired; -} - } // namespace NEO diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 2c908ce31a..206c6ac345 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -492,14 +492,14 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallGetInternalHeapsPrealloca EXPECT_EQ(productHelper->getInternalHeapsPreallocated(), 3u); } -HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTlbFlushRequiredThenFalseIsReturned, IsNotXeHpgCore) { - EXPECT_FALSE(productHelper->isTlbFlushRequired()); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTlbFlushRequiredThenTrueIsReturned, IsNotXeHpgOrXeHpcCore) { + EXPECT_TRUE(productHelper->isTlbFlushRequired()); } -HWTEST_F(ProductHelperTest, givenProductHelperAndForceTlbFlushSetWhenAskedIfIsTlbFlushRequiredThenTrueIsReturned) { +HWTEST2_F(ProductHelperTest, givenProductHelperAndForceTlbFlushNotSetWhenAskedIfIsTlbFlushRequiredThenFalseIsReturned, IsNotPVC) { DebugManagerStateRestore restore{}; - debugManager.flags.ForceTlbFlush.set(1); - EXPECT_TRUE(productHelper->isTlbFlushRequired()); + debugManager.flags.ForceTlbFlush.set(0); + EXPECT_FALSE(productHelper->isTlbFlushRequired()); } HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp index 4fdf3760e8..0315624584 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp @@ -29,6 +29,10 @@ PVCTEST_F(PvcProductHelper, whenGettingAubstreamProductFamilyThenProperEnumValue EXPECT_EQ(aub_stream::ProductFamily::Pvc, productHelper->getAubStreamProductFamily()); } +PVCTEST_F(PvcProductHelper, whenCheckIsTlbFlushRequiredThenReturnProperValue) { + EXPECT_FALSE(productHelper->isTlbFlushRequired()); +} + PVCTEST_F(PvcProductHelper, whenForceTlbFlushSetAndCheckIsTlbFlushRequiredThenReturnProperValue) { DebugManagerStateRestore restore; debugManager.flags.ForceTlbFlush.set(1); diff --git a/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp b/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp index 745fe52e25..555d70d83b 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/windows/product_helper_tests_mtl_windows.cpp @@ -13,6 +13,10 @@ using namespace NEO; using MtlProductHelperWindows = ProductHelperTestWindows; +MTLTEST_F(MtlProductHelperWindows, whenCheckIsTlbFlushRequiredThenReturnProperValue) { + EXPECT_TRUE(productHelper->isTlbFlushRequired()); +} + MTLTEST_F(MtlProductHelperWindows, whenCheckingIsTimestampWaitSupportedForEventsThenReturnTrue) { EXPECT_TRUE(productHelper->isTimestampWaitSupportedForEvents()); }