linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Direct I/O + Asynchronous I/O from kernel
@ 2012-09-21  6:41 Rajat Sharma
  2012-09-21 14:14 ` Jeff Moyer
  0 siblings, 1 reply; 3+ messages in thread
From: Rajat Sharma @ 2012-09-21  6:41 UTC (permalink / raw)
  To: Al Viro, linux-fsdevel

Hi Al,

>From a long time, I have been facing two issues in Linux kernel
related to Direct I/O and Asynchronous I/O. Although so far I have
managed to work around them, but I feel these could be easily fixed
with a kernel patch. But before working out on a patch, I thought it
is worthy to ask for an opinion about these two issues:

1. Direct I/O on Kernel Buffers:
Almost all filesystems supporting Direct I/O lock down user space
pages in memory for DMA (or network transfer) using get_user_pages (or
equivalent) function. This function strictly assumes pages to be
locked down are in user process' (calling process) address space and
hence looks for pages in all virtual memory areas (vm_area_struct)
holding the required user space address range, finds its page mapping
in page tables and locks them in memory. This function returns -EINVAL
for kernel buffers.

2. Asynchronous I/O Completion:
AIO framework maintains an IO completion event ring buffer in address
space of the requester process. When a filesystem completes AIO
request (kiocb), it calls aio_complete function which puts a
completion event in AIO ring buffer and application can consider AIO
to be done. There is no way to track down completion.

Above two limitation do not allow Direct I/O or asynchronous I/O to be
issued from kernel, using kernel buffers. As a use-case, stackable
filesystems like ecryptfs can manipulate (encrypt/decrypt) kernel
buffers and support direct I/O + Asynchronous I/O. A database engine
heavily rely on this combination and encryption has a better use case
there.

It is possible that these issues are already known and have not been
fixed for a good reason, but would be great to know anyways.

Thanks,
Rajat

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-22  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-21  6:41 Direct I/O + Asynchronous I/O from kernel Rajat Sharma
2012-09-21 14:14 ` Jeff Moyer
2012-09-22  5:40   ` Rajat Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).