mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 16:48:45 +08:00
refactor: Move PF manager init to first shared alloc create
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fe26760809
commit
a858f159cf
@@ -81,11 +81,12 @@ MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : execu
|
||||
localMemAllocsSize[rootDeviceIndex].store(0u);
|
||||
}
|
||||
|
||||
if (anyLocalMemorySupported || debugManager.isTbxPageFaultManagerEnabled()) {
|
||||
pageFaultManager = CpuPageFaultManager::create();
|
||||
if (anyLocalMemorySupported) {
|
||||
prefetchManager = PrefetchManager::create();
|
||||
}
|
||||
if (debugManager.isTbxPageFaultManagerEnabled()) {
|
||||
initPageFaultManager();
|
||||
}
|
||||
|
||||
if (anyLocalMemorySupported) {
|
||||
prefetchManager = PrefetchManager::create();
|
||||
}
|
||||
|
||||
if (debugManager.flags.EnableMultiStorageResources.get() != -1) {
|
||||
@@ -399,6 +400,21 @@ bool MemoryManager::isLimitedRange(uint32_t rootDeviceIndex) {
|
||||
return getGfxPartition(rootDeviceIndex)->isLimitedRange();
|
||||
}
|
||||
|
||||
void MemoryManager::initPageFaultManager() {
|
||||
if (pageFaultManager) {
|
||||
return;
|
||||
}
|
||||
|
||||
static std::mutex pfMtx;
|
||||
std::lock_guard<std::mutex> lock(pfMtx);
|
||||
|
||||
if (pageFaultManager) {
|
||||
return;
|
||||
}
|
||||
|
||||
pageFaultManager = CpuPageFaultManager::create();
|
||||
}
|
||||
|
||||
void MemoryManager::waitForDeletions() {
|
||||
if (deferredDeleter) {
|
||||
deferredDeleter->drain(false, false);
|
||||
|
||||
Reference in New Issue
Block a user