Message ID | 1404232537-28628-5-git-send-email-ming.lei@canonical.com |
---|---|
State | New |
Headers | show |
On 07/01/2014 10:35 AM, Ming Lei wrote: > Before commit 580b6b2aa2(dataplane: use the Qemu block > layer for I/O), dataplane for virtio-blk submits block > I/O at batch. s/at/as a/ > > This commit 580b6b2aa2 replaces the custom linux AIO > implementation(including I/O batch) with Qemu block s/(/ (/ > layer, but this commit causes ~40% throughput regression > on virtio-blk performance, and removing submitting I/O > at batch is one of the cause. s/at/as a/ > > This patch applys the new introduced bdrv_io_plug() and s/applys/applies/ s/new/newly/ > bdrv_io_unplug() interfaces to support submitting I/O > at batch for Qemu block layer, and in my test, the change s/at/as a/ > can improve thoughput by ~30% with 'aio=native'. s/thoughput/throughput/
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index c10b7b7..8fefcce 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -289,6 +289,7 @@ static void handle_notify(EventNotifier *e) int ret; event_notifier_test_and_clear(&s->host_notifier); + bdrv_io_plug(s->blk->conf.bs); for (;;) { /* Disable guest->host notifies to avoid unnecessary vmexits */ vring_disable_notification(s->vdev, &s->vring); @@ -322,6 +323,7 @@ static void handle_notify(EventNotifier *e) break; } } + bdrv_io_unplug(s->blk->conf.bs); } /* Context: QEMU global mutex held */