[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

On Wed, 28 Mar 2012, Ian Campbell wrote:
> On Tue, 2012-03-27 at 18:22 +0100, 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 Tue, 27 Mar 2012, Zhang, Yang Z wrote:
> > > > Doesn't cache mode have better performance than NOCACHE?
> > > 
> > > Actually you are correct. I think that this patch should be dropped from
> > > the series. Of course we need O_DIRECT for QDISK otherwise we do loose
> > > correctness but considering that IDE should only be used during
> > > installation it can stay as it is.
> > 
> > I don't think this assumption about IDE is correct.  To say that "IDE
> > should only be used during installation" is not an excuse for
> > providing an IDE controller which violates the usual correctness
> > rules.
> The changeset which originally made this use BDRV_O_CACHE is below, do
> the arguments made there no longer apply? To my non-qemu eye it looks
> like hw/ide.c is doing an appropriate amount of bdrv_flush().

It is not just about the IDE controller, it is also about the image
format, see below.

> 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:


It looks like KVM suggests to turn off caching with raw files or
volumes (but keep in mind that the default for them is write through):


> My recollection is that way-back-when that installation to an emulated
> IDE device with O_DIRECT was so slow that it was deemed an acceptable
> trade-off, presumably given the understanding that IDE cache control was
> working.
> I think Stefano measured it again recently, Stefano -- can you share the
> numbers you saw?

Installing Win7 X64 on my testbox takes 15 minutes with BDRV_O_CACHE_WB
and 23 minutes with BDRV_O_NOCACHE.
That means a 35% drop in performances.
Given the high difference I would be tempted to keep things as they are,
at least for raw files/devices and maybe switch to nocache just for cow

Xen-devel mailing list



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