[RFC PATCH 5/6] mm/gmem: resolve VMA conflicts for attached peer devices

2023-11-28 Thread Weixi Zhu
VMA is detected to be conflicting, it will be temporarily blacklisted. The mmap_region() function will retry other VMA candidates for a predefined number of iterations. Signed-off-by: Weixi Zhu --- fs/proc/task_mmu.c | 3 ++ include/linux/gmem.h | 26

[RFC PATCH 3/6] mm/gmem: add GMEM (Generalized Memory Management) interface for external accelerators

2023-11-28 Thread Weixi Zhu
invokes gm_as_attach() at the beginning of a CPU program. This invocation can happen inside an ioctl() call when a device context is initialized. Signed-off-by: Weixi Zhu --- include/linux/gmem.h | 196 +++ include/linux/mm_types.h | 1 +

[RFC PATCH 0/6] Supporting GMEM (generalized memory management) for external memory devices

2023-11-28 Thread Weixi Zhu
e. The idea of GMEM was originated from Weixi's PhD study with Prof. Scott Rixner and Prof. Alan L. Cox at Rice University. [1] https://arxiv.org/abs/2310.12554. Weixi Zhu (6): mm/gmem: add heterogeneous NUMA node mm/gmem: add arch-independent abstraction to track address mapping s

[RFC PATCH 4/6] mm/gmem: add new syscall hmadvise() to issue memory hints for heterogeneous NUMA nodes

2023-11-28 Thread Weixi Zhu
, allowing the page table management to be overlapped. In a test with Huawei's Ascend NPU card, the MADV_PREFETCH is able to saturate the host-device bandwidth if the given VMA size is larger than 16MB. Signed-off-by: Weixi Zhu --- arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/in

[RFC PATCH 6/6] mm/gmem: extending Linux core MM to support unified virtual address space

2023-11-28 Thread Weixi Zhu
migration data at page granules. Signed-off-by: Weixi Zhu --- kernel/fork.c| 1 + mm/huge_memory.c | 85 +++- mm/memory.c | 42 +--- mm/mmap.c| 2 ++ mm/oom_kill.c| 2 ++ mm/vm_object.c | 84

[RFC PATCH 2/6] mm/gmem: add arch-independent abstraction to track address mapping status

2023-11-28 Thread Weixi Zhu
format vary arch by arch, which harms the extensibility. [1] https://docs.freebsd.org/en/articles/vm-design/ Signed-off-by: Weixi Zhu --- include/linux/gmem.h | 120 + include/linux/mm_types.h | 4 + mm/Makefile | 2 +- mm/vm_obje

[RFC PATCH 1/6] mm/gmem: add heterogeneous NUMA node

2023-11-28 Thread Weixi Zhu
device local DRAM, where a cache-coherent bus does not need to exist between the CPU and device local DRAM. Furthermore, this allows an application user to issue memory hints that bind with specific hNUMA nodes. Signed-off-by: Weixi Zhu --- drivers/base/node.c | 6 include/linux/gmem.h