SWDEV-492049 - Remove the handle of Phy Mem from Memobj

The hipGraph will use VMM by default when allocating memory.
However, the handle of Phy mem has been added to Memobj by default.
Since the Memobj will track the whole address range from handle to
handle + size, this needs the system to reserve the whole address
range. If the system range have not reserved by the system, then it
will have the potential issue that clr finds the Memobj incorrectly.

This patch removes the handle from the Memobj to fix this potential
issue.

Change-Id: I2da38e6b2d11d0d48e1afe66c46899500c290624


[ROCm/clr commit: 231b2410a0]
此提交包含在:
Shane Xiao
2024-10-17 15:54:23 +08:00
提交者 yao xiao
父節點 7d7aa8b69c
當前提交 dabe311bd8
共有 2 個檔案被更改,包括 6 行新增0 行删除
+4
查看文件
@@ -2335,6 +2335,10 @@ class GraphMemAllocNode final : public GraphNode {
memory_ = getMemoryObject(dptr, offset);
// Retain memory object because command release will release it
memory_->retain();
// Remove because the entry is not needed in MemObjMap after the memory_ has been saved.
// The Phy mem obj will be saved in virtual memory object during VirtualMapCommand::submit.
amd::MemObjMap::RemoveMemObj(dptr);
size_ = aligned_size;
// Execute the original mapping command
VirtualMapCommand::submit(device);
+2
查看文件
@@ -216,6 +216,8 @@ void* MemoryPool::AllocateMemory(size_t size, Stream* stream, void* dptr) {
}
} else {
dev_ptr = memory->getSvmPtr();
if (!amd::MemObjMap::FindMemObj(dev_ptr))
amd::MemObjMap::AddMemObj(dev_ptr, memory);
}
// Place the allocated memory into the busy heap
ts.AddSafeStream(stream);