Linux 7.4 Introduces DMA-BUF Support To I/O Path With IO_uring

Linux 7.4 Introduces DMA-BUF Support To I/O Path With IO_uring

Merged today for the ongoing Linux 7.4 merge window is the infrastructure for enabling DMA-BUF support in the kernel's I/O path with the wonderful IO_uring framework. This concept has been talked about for a while and there were prior patches with similar aim while now it's finally materialized in mainline with Linux 7.4 for enabling DMA-BUF read/write support via IO_uring. Linux's DMA-BUF framework allows for different device drivers and subsystems for sharing hardware memory buffers without requiring copies by the CPU. DMA-BUF is especially popular among GPU drivers and has also seen work in media and network drivers for efficient zero-copy buffer sharing. Pavel Begunkov who led the work through eleven rounds of patch review explained of this new functionality: "It's an opt-in feature for files, and they need to implement a new file operation to use it. Only NVMe block devices are supported in this series. The user API is built on top of io_uring's "registered buffers", where a dmabuf is registered in a special way, but after it can be used as any other "registered buffer" with IORING_OP_{READ,WRITE}_FIXED requests. It's created via a new file operation and the resulted map is then passed through the I/O stack in a new iterator type. There is some additional infrastructure to glue it together, count requests, manage lifetime and implement invalidation." Some benchmark numbers shown in that patch series cover letter are quite impressive: Again this is only ired up so far with the raw NVMe PCIe block devices. The DMA-BUF buffers for block devices can be up to 4GB in size. More details on this new functionality can be found via this Git merge to Linux 7.4.

Original Source

Read the full article at Phoronix →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.