All of lore.kernel.org
 help / color / mirror / Atom feed
* Approaches to making io_submit not block
@ 2011-08-29 17:33 Daniel Ehrenberg
  2011-08-30  5:32 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Daniel Ehrenberg @ 2011-08-29 17:33 UTC (permalink / raw)
  To: linux-kernel

Hi,

The Linux AIO interface (io_submit, io_getevents, etc) is useful in
allowing multiple requests to through the I/O stack without requiring
a userspace or even kernel thread per pending request. This is really
great for maxing out high-performance devices like SSDs. However, it
seems incomplete to me because io_submit sometimes blocks for a couple
filesystem-related reasons. I'm wondering if this could be fixed, or
if there is an inherent need for this sort of blocking.

- Blocking due to reading metadata.
Proposed solution:
Add a per-ioctx work queue to do metadata reads. It will be triggered
from the dio code: if in async mode, then get_block will be called
with an additional flag, meaning something like O_NONBLOCK on sockets.
File systems' get_block functions can implement this flag and return
-EAGAIN if a read from the underlying device would be necessary. (If
we're worried that EAGAIN might be used for other purposes in the
future, we could make a new errno for this purpose.) From a quick
glance at the code, it looks like this would not be too difficult to
add to ext4 for extent-based files, and support in other file systems
could be added gradually. If -EAGAIN is returned, then the struct dio
will be put on the work queue together with a description of what kind
of processing it was doing. The work queue only serves the metadata
request, and the rest of the request is served on the existing path.

- Blocking for appends and writes to file holes due to the need for a
metadata write after the data write
Proposed solution:
Maintain a work queue for all appends and writes to file holes, which
executes the current code.

Has anything like this been discussed or implemented? What I'm talking
about isn't optimal in terms of parallelism; it just matches the
parallelism of the current approach (with the minor caveat that
multiple threads on the same core calling io_submit on the same ioctx
don't get to run their metadata/append I/O requests concurrently), but
allows the io_submit system call to return to userspace much faster.
I've read about other proposals for general asynchronous syscalls, but
this would be lighter weight in not requiring a kernel task per I/O
request.

Thanks,
Dan

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

end of thread, other threads:[~2011-09-02 13:11 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-29 17:33 Approaches to making io_submit not block Daniel Ehrenberg
2011-08-30  5:32 ` Christoph Hellwig
2011-08-30 21:51   ` Daniel Ehrenberg
2011-08-31  5:26     ` Christoph Hellwig
2011-08-31 17:08       ` Andi Kleen
2011-08-31 21:00         ` Daniel Ehrenberg
2011-08-31 21:15           ` Andi Kleen
2011-09-01  4:18         ` Dave Chinner
2011-09-01  4:39           ` Andi Kleen
2011-09-01  6:54             ` Dave Chinner
2011-09-02 13:08               ` Ted Ts'o
2011-09-02 13:10                 ` Christoph Hellwig
2011-09-01  3:39       ` Dave Chinner
2011-09-01  4:20         ` Christoph Hellwig
2011-08-30  7:02 ` Andi Kleen
     [not found] ` <CAAK6Zt0Sh1GdEOb-tNf2FGXJs=e1Jbcqew13R_GdTqrv6vW97w@mail.gmail.com>
     [not found]   ` <x49k49uk2ox.fsf@segfault.boston.devel.redhat.com>
     [not found]     ` <4E5D5817.6040704@kernel.dk>
2011-08-30 22:19       ` Daniel Ehrenberg
2011-08-30 22:32         ` Jens Axboe
2011-08-30 22:41           ` Andrew Morton
2011-08-30 22:45             ` Daniel Ehrenberg
2011-08-30 22:54               ` Andrew Morton
2011-08-30 23:03                 ` Jeremy Allison
2011-08-30 23:11                   ` Andrew Morton
2011-08-31 11:04                     ` Ulrich Drepper
2011-08-31 16:59                       ` Jeremy Allison
2011-09-01 11:14                         ` Ulrich Drepper
2011-09-01 15:58                           ` Jeremy Allison
2011-09-01 16:04                             ` Christoph Hellwig
2011-09-01 16:15                               ` Jeremy Allison
2011-09-01 16:23                                 ` Christoph Hellwig
2011-09-01 16:31                                   ` Jeremy Allison
2011-09-01 16:34                                     ` Christoph Hellwig
2011-09-01 16:34                                     ` Jeremy Allison
2011-09-01 16:45                                       ` Christoph Hellwig
2011-09-01 16:57                                         ` Jeremy Allison
2011-08-31  5:34                   ` Christoph Hellwig
2011-08-31  6:04                 ` guy keren
2011-08-31 23:16                   ` Daniel Ehrenberg
2011-08-31 23:48                     ` guy keren
2011-08-31 23:59                       ` Daniel Ehrenberg
2011-08-31 15:45                 ` Gleb Natapov
2011-08-31 16:02                   ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.