New issue
Advanced search Search tips

Issue 901139 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

crosvm: out-of-order I/O for virtio-blk

Project Member Reported by smbar...@chromium.org, Nov 1

Issue description

virtio-blk allows (or really, expects) requests to be served out of order. We should add support for this to improve disk throughput.

This is spun out of  issue 901108  where I noticed that a single sqlite INSERT can be blocked for over 5 seconds because it's behind hundreds of megabytes of container image tarball.
 
Labels: -Pri-3 Pri-2
Owner: dverkamp@chromium.org
Status: Assigned (was: Untriaged)
Not actively working on this yet, but recording some thoughts for later...

The tricky part of this will be in the disk image file format implementations.

I'm not sure it's worth the trouble to try this for qcow2, since a lot of its operations currently depend on being single-threaded for safety (allocating new clusters, updating L1/L2 tables and refcounts, etc.).  We could try to add locking around the critical sections, but the plan going forward is to use raw images for performance anyway. We'll still need to allow qcow images, but they can probably be limited to synchronous I/O (or only one worker thread).

For raw images, it should be much more tractable, but we need to figure out what asynchronous I/O strategy to use.  A few options:
- Thread pool with each worker executing normal blocking I/O (probably the simplest; just need to distribute requests to workers somehow).
- Linux AIO (libaio) via a Rust wrapper (note that there is currently no asynchronous fsync(), and io_submit() may block on some operations like allocating blocks in the underlying filesystem, so this isn't fully asynchronous; also, we'd need to switch to opening the image with O_DIRECT, bypassing the page cache).
- Some existing asynchronous I/O framework like tokio (this seems to be mostly focused on network sockets; I'm not sure what it does for local file I/O).

Sign in to add a comment