xen_disk: use NATIVE_AIO and NOCACHE
Anthony,
please pull this small patch series that allows xen_disk to be used correctly with NATIVE_AIO and O_DIRECT.
This series should be backported to the stable branch too.
Stefano Stabellini (2):
xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
xen_disk: when using AIO flush after the operation is completed
hw/xen_disk.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
git://xenbits.xen.org/people/sstabellini/qemu-dm.git disk_io
Cheers,
Stefano
PATCH 1/2 xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
--- hw/xen_disk.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/xen_disk.c +2 -2
@@ -584,10 +584,10 @@ static int blk_init(struct XenDevice *xendev) }/* read-only ? */ + qflags =BDRV_O_NOCACHE |BDRV_O_CACHE_WB |BDRV_O_NATIVE_AIO ;if (strcmp (blkdev->mode,"w" ) ==0 ) { - qflags =BDRV_O_RDWR ; + qflags |=BDRV_O_RDWR ; }else { - qflags =0 ; info |=VDISK_READONLY ; }
Signature · 1 line
1.7.2.5
PATCH 2/2 xen_disk: when using AIO flush after the operation is completed
In reply to Stefano StabelliniIf ioreq->postsync call bdrv_flush when the AIO operation is actually completed.
--- hw/xen_disk.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
hw/xen_disk.c +3 -3
@@ -330,6 +330,9 @@ static void qemu_aio_complete(void *opaque, int ret)if (ioreq->aio_inflight >0 ) {return ; } +if (ioreq->postsync) { +bdrv_flush (ioreq->blkdev->bs); + } ioreq->status = ioreq->aio_errors ?BLKIF_RSP_ERROR :BLKIF_RSP_OKAY ;ioreq_unmap (ioreq);
@@ -376,9 +379,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) goto err; } -if (ioreq->postsync) { -bdrv_flush (blkdev->bs);/* FIXME: aio_flush() ??? */ - }qemu_aio_complete (ioreq,0 );return 0 ;
Signature · 1 line
1.7.2.5
Quoted 5 lines · Stefano Stabellini
Anthony,
please pull this small patch series that allowsxen_diskto be used correctly withNATIVE_AIOandO_DIRECT.This series should be backported to the stable branch too.
Any plans to add BLKIF_OP_FLUSH_DISKCACHE support to xen_disk? Unlike the old bnroken Xen barrier scheme this actually implements pure flushes for fdatasync or blockdevice O_SYNC I/O corectly, and for modern Linux kernels it actually will be quite a bit faster, too.
Quoted 11 lines · Christoph Hellwig
Quoted 5 lines · Stefano Stabellini
Anthony,
please pull this small patch series that allowsxen_diskto be used correctly withNATIVE_AIOandO_DIRECT.This series should be backported to the stable branch too.
Any plans to add
BLKIF_OP_FLUSH_DISKCACHEsupport toxen_disk? Unlike the old bnroken Xen barrier scheme this actually implements pure flushes for fdatasync or blockdeviceO_SYNCI/O corectly, and for modern Linux kernels it actually will be quite a bit faster, too.
Yeah, that's a good suggestion, it shouldn't be hard either.
Quoted 5 lines · Stefano Stabellini
Anthony,
please pull this small patch series that allowsxen_diskto be used correctly withNATIVE_AIOandO_DIRECT.This series should be backported to the stable branch too.
Pulled. Thanks.
Regards,
Anthony Liguori
Quoted 15 lines
Stefano Stabellini (2):
xen_disk: open disk withBDRV_O_NOCACHE|BDRV_O_CACHE_WB|BDRV_O_NATIVE_AIO
xen_disk: when using AIO flush after the operation is completedhw/xen_disk.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
git://xenbits.xen.org/people/sstabellini/qemu-dm.gitdisk_ioCheers,
Stefano