On Mon, Mar 18, 2013 at 7:10 PM, Stefan Hajnoczi <[email protected]> wrote: [...] > read/write/flush should be either .bdrv_co_* or .bdrv_aio_*. > > The current code pauses the guest while I/O is in progress! Try running > disk I/O benchmarks inside the guest and you'll see that performance and > interactivity are poor. > > QEMU has two ways of implementing efficient block drivers: > > 1. Coroutines - .bdrv_co_* > > Good for image formats or block drivers that have internal logic. > > Each request runs inside a coroutine - see include/block/coroutine.h. > In order to wait for I/O, submit an asynchronous request or worker > thread and yield the coroutine. When the request completes, re-enter > the coroutine and continue. > > Examples: block/sheepdog.c or block/qcow2.c. > > 2. Asynchronous I/O - .bdrv_aio_* > > Good for low-level block drivers that have little logic. > > The request processing code is split into callbacks. I/O requests are > submitted and then the code returns back to QEMU's main loop. When the > I/O request completes, a callback is invoked. > > Examples: block/rbd.c or block/qed.c. >
HLFS do not use QEMU's AIO way. HLFS, itself, has realized internal AIO. -- Thanks Harry Wei
