mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
feature: capture multiple cpu pagefault handler
Recorded multiple page fault handlers by using vector in cpu_page_fault_manager_linux. Added a static handlerIndex in order to track the depth of handler logic to call appropriate previous handlers. Related-To: NEO-11563 Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e1af5d8da7
commit
44f2912195
@@ -95,14 +95,16 @@ inline void PageFaultManager::migrateStorageToGpuDomain(void *ptr, PageFaultData
|
||||
pageFaultData.domain = AllocationDomain::gpu;
|
||||
}
|
||||
|
||||
bool PageFaultManager::verifyPageFault(void *ptr) {
|
||||
bool PageFaultManager::verifyAndHandlePageFault(void *ptr, bool handlePageFault) {
|
||||
std::unique_lock<SpinLock> lock{mtx};
|
||||
for (auto &alloc : this->memoryData) {
|
||||
auto allocPtr = alloc.first;
|
||||
auto &pageFaultData = alloc.second;
|
||||
if (ptr >= allocPtr && ptr < ptrOffset(allocPtr, pageFaultData.size)) {
|
||||
this->setAubWritable(true, allocPtr, pageFaultData.unifiedMemoryManager);
|
||||
gpuDomainHandler(this, allocPtr, pageFaultData);
|
||||
if (handlePageFault) {
|
||||
this->setAubWritable(true, allocPtr, pageFaultData.unifiedMemoryManager);
|
||||
gpuDomainHandler(this, allocPtr, pageFaultData);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user