Files
compute-runtime/shared/source/page_fault_manager/tbx_page_fault_manager.h
Jack Myers c26d24e555 fix: tbx page fault manager hang issue
- Updated `isAllocTbxFaultable` to exclude `gpuTimestampDeviceBuffer` from being
faultable.
- Replaced `SpinLock` with `RecursiveSpinLock` in `CpuPageFaultManager` and
`TbxPageFaultManager` to allow recursive locking.
- Added unit tests to verify the correct handling of `gpuTimestampDeviceBuffer`
in `TbxCommandStreamTests`.

Related-To: NEO-13748
Signed-off-by: Jack Myers <jack.myers@intel.com>
2025-02-18 05:05:38 +01:00

45 lines
1.3 KiB
C++

/*
* Copyright (C) 2024-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/page_fault_manager/cpu_page_fault_manager.h"
namespace NEO {
class CommandStreamReceiver;
class GraphicsAllocation;
class TbxPageFaultManager : public virtual CpuPageFaultManager {
public:
struct PageFaultDataTbx {
size_t size;
bool hasBeenDownloaded = false;
GraphicsAllocation *gfxAllocation = nullptr;
uint32_t bank = 0;
CommandStreamReceiver *csr = nullptr;
};
static std::unique_ptr<TbxPageFaultManager> create();
TbxPageFaultManager() = default;
using CpuPageFaultManager::insertAllocation;
using CpuPageFaultManager::removeAllocation;
void insertAllocation(CommandStreamReceiver *csr, GraphicsAllocation *alloc, uint32_t bank, void *ptr, size_t size) override;
void removeAllocation(GraphicsAllocation *alloc) override;
using CpuPageFaultManager::checkFaultHandlerFromPageFaultManager;
bool verifyAndHandlePageFault(void *ptr, bool handlePageFault) override;
protected:
void handlePageFault(void *ptr, PageFaultDataTbx &faultData);
std::unordered_map<void *, PageFaultDataTbx> memoryDataTbx;
RecursiveSpinLock mtxTbx;
};
} // namespace NEO