mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 09:30:36 +08:00
fix: residency leak
- properly add needsMakeResidentBeforeLock in Wddm Allocation so while destroying the allocation it is properly removed from wddm residency controller - add cannot trim further flag after eviction - fix debug variable Related-To: NEO-11731 Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1cba900ad9
commit
c817d15b59
@@ -1129,6 +1129,7 @@ TEST_F(WddmLockWithMakeResidentTests, whenApplyBlockingMakeResidentAndMakeReside
|
||||
EXPECT_EQ(0u, mockTemporaryResources->resourceHandles.size());
|
||||
EXPECT_EQ(1u, mockWddm.evictResult.called);
|
||||
EXPECT_EQ(allocation.handle, mockWddm.makeResidentResult.handlePack[0]);
|
||||
EXPECT_TRUE(mockWddm.makeResidentResult.cantTrimFurther);
|
||||
EXPECT_EQ(3u, mockWddm.makeResidentResult.called);
|
||||
}
|
||||
|
||||
|
||||
@@ -1331,13 +1331,19 @@ TEST_F(WddmMemoryManagerSimpleTest, whenAllocationCreatedFromSharedHandleIsDestr
|
||||
EXPECT_EQ(7u, destroyArg.AllocationCount);
|
||||
gdi->getDestroyArg().AllocationCount = 0;
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationThatDoesntNeedMakeResidentBeforeLockThenDontEvictAllocationFromWddmTemporaryResources) {
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingLockedAllocationIfDeviceRequiresMakeResidentPriorToLockThenCallEvictDoNotCallOtherwise) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.ForcePreferredAllocationMethod.set(static_cast<int32_t>(GfxMemoryAllocationMethod::useUmdSystemPtr));
|
||||
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize}));
|
||||
memoryManager->lockResource(allocation);
|
||||
EXPECT_FALSE(allocation->needsMakeResidentBeforeLock());
|
||||
auto makeResidentPriorToLockRequired = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[0u]->getHelper<GfxCoreHelper>().makeResidentBeforeLockNeeded(allocation->needsMakeResidentBeforeLock());
|
||||
EXPECT_EQ(makeResidentPriorToLockRequired, allocation->needsMakeResidentBeforeLock());
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
if (makeResidentPriorToLockRequired) {
|
||||
EXPECT_EQ(1u, mockTemporaryResources->removeResourceResult.called);
|
||||
} else {
|
||||
EXPECT_EQ(0u, mockTemporaryResources->removeResourceResult.called);
|
||||
}
|
||||
EXPECT_EQ(0u, mockTemporaryResources->evictResourceResult.called);
|
||||
}
|
||||
TEST_F(WddmMemoryManagerSimpleTest, whenDestroyingNotLockedAllocationThatDoesntNeedMakeResidentBeforeLockThenDontEvictAllocationFromWddmTemporaryResources) {
|
||||
|
||||
Reference in New Issue
Block a user