Add pageFault migration support for immediate cmdlist submission via flushTask.

Move logic for makeResident & pageFault migration to command place for re-use.

Signed-off-by: Vinod Tipparaju <vinod.tipparaju@intel.com>
This commit is contained in:
Vinod Tipparaju
2021-07-16 16:17:08 +05:30
committed by Compute-Runtime-Automation
parent 37670aeb91
commit a2012e04dc
6 changed files with 231 additions and 20 deletions

View File

@@ -359,28 +359,13 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
commandList->getPrintfFunctionContainer().begin(),
commandList->getPrintfFunctionContainer().end());
for (auto alloc : commandList->commandContainer.getResidencyContainer()) {
if (csr->getResidencyAllocations().end() ==
std::find(csr->getResidencyAllocations().begin(), csr->getResidencyAllocations().end(), alloc)) {
csr->makeResident(*alloc);
if (performMigration) {
if (alloc &&
(alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_GPU ||
alloc->getAllocationType() == NEO::GraphicsAllocation::AllocationType::SVM_CPU)) {
pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast<void *>(alloc->getGpuAddress()));
}
}
}
}
commandList->csr = csr;
commandList->makeResidentAndMigrate(performMigration);
}
if (performMigration) {
DriverHandleImp *driverHandleImp = static_cast<DriverHandleImp *>(device->getDriverHandle());
std::lock_guard<std::mutex> lock(driverHandleImp->sharedMakeResidentAllocationsLock);
for (auto alloc : driverHandleImp->sharedMakeResidentAllocations) {
pageFaultManager->moveAllocationToGpuDomain(reinterpret_cast<void *>(alloc.second->getGpuAddress()));
}
auto commandList = CommandList::fromHandle(phCommandLists[0]);
commandList->migrateSharedAllocations();
}
if (stateSipRequired) {