Peer-to-peer DMA (P2PDMA) has been part of the kernel since the 4.20 release in 2018; it provides a framework that allows devices to transfer data between themselves directly, without using system RAM for the transfer. At the 2025 Linux Storage, Filesystem, Memory Management, and BPF Summit (LSFMM+BPF), Stephen Bates led a combined storage, filesystems, and memory-management session on device-initiated I/O, which is perhaps what P2PDMA is evolving toward. Two years ago, he led a session on P2PDMA at the summit; this year's session was a brief update on P2PDMA with a look at where it may be heading.
自 2018 年的 4.20 版本起,点对点 DMA(P2PDMA)就已成为内核的一部分;它提供了一个框架,使设备之间可以直接传输数据,而无需通过系统内存。2025 年的 Linux 存储、文件系统、内存管理与 BPF 峰会(LSFMM+BPF)上,Stephen Bates 主持了一场关于设备发起 I/O 的联合会议,涵盖存储、文件系统和内存管理主题,而这或许正是 P2PDMA 的发展方向。两年前,他曾在峰会上主持过一场关于 P2PDMA 的会议;今年的会议则是对 P2PDMA 的简要更新,并探讨了其可能的演进方向。
He began by looking at where P2PDMA is today. It started as an in-kernel API that enabled DMA requests between PCIe devices; one of the first users of the API was the NVMe-over-fabrics target, which allowed data to flow directly into an NVMe drive via remote DMA (RDMA). Access to the feature from user space was added, so that mmap() could be used to map device memory. That capability is being used by some companies, sometimes in conjunction with out-of-tree patches expanding the functionality.
他首先回顾了 P2PDMA 的现状。最初,它是一个内核内的 API,用于在 PCIe 设备之间发起 DMA 请求;该 API 的首批用户之一是 NVMe-over-fabrics 目标端,这使得可以通过远程 DMA(RDMA)将数据直接传输到 NVMe 硬盘。后来又添加了从用户空间访问该功能的能力,可以通过 mmap() 将设备内存映射到用户空间。当前有一些公司正在使用这一能力,有时还会配合一些内核之外的补丁来扩展功能。
Bates admitted to having stepped away from P2PDMA for a bit due to a job change and other distractions, so he was not entirely sure about the status of the feature in some respects. He wondered about Arm 64-bit support; Christoph Hellwig said that it is supported, which means that architecture support is in pretty good shape, Bates said.
Bates 承认,由于换工作和其他事务,他曾暂时离开过 P2PDMA 的开发,因此他对该功能在某些方面的现状不是很确定。他询问了对 Arm 64 位架构的支持情况;Christoph Hellwig 表示该架构已经获得支持,Bates 因此认为整体的架构支持状况还算不错。
Trying to do P2PDMA in the presence of an I/O memory-management unit (IOMMU) had been difficult, he said, so initially users turned off IOMMUs; that is not required any longer. There are a handful of PCIe features that have gained support, including page request interfa