[PATCH 0/4] add struct page and Direct I/O support to reserved memory

Li Chen me at linux.beauty
Mon Jul 11 09:05:06 PDT 2022


Hi Christoph,
 ---- On Mon, 11 Jul 2022 23:01:32 +0800  Christoph Hellwig <hch at infradead.org> wrote --- 
 > Who is going to use it and how?  Because normally the reserved memory
 > is used through the DMA allocator, and you can't just do direct I/O
 > to that.
 > 

My use case has been stated in the cover letter, but our driver is not ready for upstream yet.

With DMA allocator, we can access buffer in kernel space, not userspace, however, this patch
series servers for userspace direct I/O, so that you can mmap device file as src buffer from userspace,
and dio to file on disk.


There are some mmap + rmem cases in the kernel source tree which don't use the DMA allocator already.

I also found some users have asked for a solution of supporting direct I/O on file_operation->mmap like:
https://stackoverflow.com/questions/44820740/using-o-direct-with-io-memory
https://www.mail-archive.com/support-list@support.elphel.com/msg02314.html

I believe there are some other potential users who didn't post questions on the internet.

If the upstream kernel has this feature, these users can mmap their
reserved memory to userspace and get direct i/o support.

Regards,
Li



More information about the linux-arm-kernel mailing list