mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
Dont make allocations non-AubWritable during migration
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b891ec2588
commit
e8cbcd2ab9
@@ -32,7 +32,6 @@ void PageFaultManager::insertAllocation(void *ptr, size_t size, SVMAllocsManager
|
||||
std::unique_lock<SpinLock> lock{mtx};
|
||||
this->memoryData.insert(std::make_pair(ptr, PageFaultData{size, unifiedMemoryManager, cmdQ, domain}));
|
||||
if (!initialPlacementCpu) {
|
||||
this->setAubWritable(false, ptr, unifiedMemoryManager);
|
||||
this->protectCPUMemoryAccess(ptr, size);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +54,6 @@ void PageFaultManager::moveAllocationToGpuDomain(void *ptr) {
|
||||
if (alloc != memoryData.end()) {
|
||||
auto &pageFaultData = alloc->second;
|
||||
if (pageFaultData.domain != AllocationDomain::Gpu) {
|
||||
this->setAubWritable(false, ptr, pageFaultData.unifiedMemoryManager);
|
||||
if (pageFaultData.domain == AllocationDomain::Cpu) {
|
||||
if (DebugManager.flags.PrintUmdSharedMigration.get()) {
|
||||
printf("UMD transferring shared allocation %llx from CPU to GPU\n", reinterpret_cast<unsigned long long int>(ptr));
|
||||
@@ -74,7 +72,6 @@ void PageFaultManager::moveAllocationsWithinUMAllocsManagerToGpuDomain(SVMAllocs
|
||||
auto allocPtr = alloc.first;
|
||||
auto &pageFaultData = alloc.second;
|
||||
if (pageFaultData.unifiedMemoryManager == unifiedMemoryManager && pageFaultData.domain != AllocationDomain::Gpu) {
|
||||
this->setAubWritable(false, allocPtr, pageFaultData.unifiedMemoryManager);
|
||||
if (pageFaultData.domain == AllocationDomain::Cpu) {
|
||||
if (DebugManager.flags.PrintUmdSharedMigration.get()) {
|
||||
printf("UMD transferring shared allocation %llx from CPU to GPU\n", reinterpret_cast<unsigned long long int>(allocPtr));
|
||||
|
||||
@@ -110,7 +110,6 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocsWhenMovingToGpuDomainAllocs
|
||||
EXPECT_EQ(pageFaultManager->protectedMemoryAccessAddress, alloc1);
|
||||
EXPECT_EQ(pageFaultManager->protectedSize, 10u);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuAddress, alloc1);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocsWhenMovingToGpuDomainWithPrintUsmSharedMigrationDebugKeyThenMessageIsPrinted) {
|
||||
@@ -173,7 +172,6 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocsWhenMovingToGpuDomainAllocs
|
||||
EXPECT_EQ(pageFaultManager->protectedMemoryAccessAddress, alloc1);
|
||||
EXPECT_EQ(pageFaultManager->protectedSize, 10u);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuAddress, alloc1);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenMoveToGpuDomainThenTransferToGpuIsCalled) {
|
||||
@@ -195,7 +193,6 @@ TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenMoveToGpuDomainThenTrans
|
||||
EXPECT_EQ(pageFaultManager->protectedMemoryAccessAddress, alloc);
|
||||
EXPECT_EQ(pageFaultManager->protectedSize, 10u);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuAddress, alloc);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenUnifiedMemoryAllocWhenMoveToGpuDomainWithPrintUsmSharedMigrationDebugKeyThenMessageIsPrinted) {
|
||||
@@ -486,7 +483,6 @@ TEST_F(PageFaultManagerTest, givenInitialPlacementCpuWhenMovingToGpuDomainThenFi
|
||||
EXPECT_EQ(pageFaultManager->protectMemoryCalled, 1);
|
||||
EXPECT_EQ(pageFaultManager->transferToCpuCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuCalled, 1);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
|
||||
EXPECT_EQ(pageFaultManager->protectedMemoryAccessAddress, alloc);
|
||||
EXPECT_EQ(pageFaultManager->protectedSize, 10u);
|
||||
@@ -513,7 +509,6 @@ TEST_F(PageFaultManagerTest, givenInitialPlacementGpuWhenMovingToGpuDomainThenFi
|
||||
EXPECT_EQ(pageFaultManager->protectMemoryCalled, 1);
|
||||
EXPECT_EQ(pageFaultManager->transferToCpuCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuCalled, 0);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
}
|
||||
|
||||
TEST_F(PageFaultManagerTest, givenAllocationMovedToGpuDomainWhenVerifyingPagefaultThenAllocationIsMovedToCpuDomain) {
|
||||
@@ -535,7 +530,6 @@ TEST_F(PageFaultManagerTest, givenAllocationMovedToGpuDomainWhenVerifyingPagefau
|
||||
EXPECT_EQ(pageFaultManager->protectMemoryCalled, 1);
|
||||
EXPECT_EQ(pageFaultManager->transferToCpuCalled, 0);
|
||||
EXPECT_EQ(pageFaultManager->transferToGpuCalled, 0);
|
||||
EXPECT_FALSE(pageFaultManager->isAubWritable);
|
||||
|
||||
pageFaultManager->verifyPageFault(alloc);
|
||||
EXPECT_EQ(pageFaultManager->allowMemoryAccessCalled, 1);
|
||||
|
||||
Reference in New Issue
Block a user