mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
refactor: Add key to not register pagefault handler on migration
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9d312995e2
commit
8217b76cef
@@ -26,6 +26,7 @@ SetCommandStreamReceiver = -1
|
||||
TbxPort = 4321
|
||||
TbxFrontdoorMode = 0
|
||||
FlattenBatchBufferForAUBDump = 0
|
||||
RegisterPageFaultHandlerOnMigration = 1
|
||||
AddPatchInfoCommentsForAUBDump = 0
|
||||
UseAubStream = 1
|
||||
AUBDumpAllocsOnEnqueueReadOnly = 0
|
||||
|
||||
@@ -289,6 +289,32 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenMoveToGpuDomainTwiceThen
|
||||
EXPECT_TRUE(pageFaultManager->checkFaultHandlerFromPageFaultManager());
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenRegisterPageFaultHandlerOnMigrationDisabledWhenMoveToGpuDomainThenDoNotRegisterHandler) {
|
||||
DebugManagerStateRestore restorer;
|
||||
debugManager.flags.RegisterPageFaultHandlerOnMigration.set(false);
|
||||
|
||||
void *cmdQ = reinterpret_cast<void *>(0xFFFF);
|
||||
void *alloc1 = reinterpret_cast<void *>(0x1);
|
||||
|
||||
pageFaultManager->insertAllocation(alloc1, 10u, unifiedMemoryManager.get(), cmdQ, {});
|
||||
EXPECT_EQ(pageFaultManager->memoryData.size(), 1u);
|
||||
EXPECT_EQ(pageFaultManager->transferToCpuCalled, 0);
|
||||
|
||||
EXPECT_FALSE(pageFaultManager->checkFaultHandlerFromPageFaultManager());
|
||||
|
||||
pageFaultManager->moveAllocationToGpuDomain(alloc1);
|
||||
EXPECT_EQ(pageFaultManager->allowMemoryAccessCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->protectMemoryCalled, 1);
|
||||
EXPECT_EQ(pageFaultManager->transferToCpuCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuCalled, 1);
|
||||
EXPECT_EQ(pageFaultManager->registerFaultHandlerCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->protectedMemoryAccessAddress, alloc1);
|
||||
EXPECT_EQ(pageFaultManager->protectedSize, 10u);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuAddress, alloc1);
|
||||
|
||||
EXPECT_FALSE(pageFaultManager->checkFaultHandlerFromPageFaultManager());
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenMovingToGpuDomainThenUpdateNonGpuAllocsContainer) {
|
||||
void *alloc1 = reinterpret_cast<void *>(0x1);
|
||||
void *alloc2 = reinterpret_cast<void *>(0x2);
|
||||
|
||||
Reference in New Issue
Block a user