[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/3] qemu-xen-traditional: use O_DIRECT to open disk images for IDE [and 1 more messages]



On Thu, 29 Mar 2012, Ian Jackson wrote:
> Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 1/3] qemu-xen-traditional: 
> use O_DIRECT to open disk images for IDE"):
> > On Thu, 29 Mar 2012, Ian Jackson wrote:
> > > Ian Campbell writes ("Re: [Xen-devel] [PATCH 1/3] qemu-xen-traditional: 
> > > use O_DIRECT to open disk images for IDE"):
> > > So I think qemu-xen-unstable the use of write-back cacheing for
> > > bdrv_write is correct.  (Apart from the wrinkle that the emulated
> > > drive cache, write_cache, is enabled by default - but I wouldn't be
> > > surprised if that accurately emulated the behaviour of real disks.)
> > 
> > You have missed my other emails on this thread about other disk formats
> > and related bug reports.
> 
> I guess you mean this, which I had read:
> 
> Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 1/3] qemu-xen-traditional: 
> use O_DIRECT to open disk images for IDE"):
> > On Wed, 28 Mar 2012, Ian Campbell wrote:
> > > I think it is possible that we've incorrectly determined that
> > > BDRV_O_CACHE has issues with correctness?
> > 
> > Following the latest disk cache thread on qemu-devel
> > (http://marc.info/?l=qemu-devel&m=127434799425483) it looks like some
> > image formats are unsafe with BDRV_O_CACHE_WB:
> 
> I'm not convinced that this bug applies to the approach taken in
> qemu-xen-unstable, because in qemu-xen-unstable we always call
> bdrv_flush at an appropriate point, and bdrv_flush is plumbed through
> by qcow_aio_flush to a flush of the underlying device.
 
I think it does.
Here is an example:


In qemu-xen you can easily have this sequence of calls:

bdrv_co_writev -> qcow2_co_writev -> qcow2_alloc_cluster_offset ->
get_cluster_table -> qcow2_grow_l1_table -> bdrv_pwrite_sync



In qemu-xen-traditional they would become:

qcow_aio_write_cb -> alloc_cluster_offset -> get_cluster_table ->
grow_l1_table -> bdrv_pwrite


The key piece of information is that bdrv_pwrite_sync issues a
bdrv_flush if the file was opened as WB, while bdrv_pwrite does not.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.