qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: Chunqiang Tang <ctang@us.ibm.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] Propose the Fast Virtual Disk (FVD) image format that outperforms QCOW2 by 249%
Date: Wed, 19 Jan 2011 23:56:15 +0000	[thread overview]
Message-ID: <20110119235615.GA13494@shareable.org> (raw)
In-Reply-To: <OF09F711B1.7B153722-ON8525781D.00532597-8525781D.0053E720@us.ibm.com>

Chunqiang Tang wrote:
> > >> Moreover, using a host file system not only adds overhead, but
> > >> also introduces data integrity issues. Specifically, if I/Os uses 
> O_DSYNC,
> > >> it may be too slow. If I/Os use O_DIRECT, it cannot guarantee data
> > >> integrity in the event of a host crash. See
> > >> http://lwn.net/Articles/348739/ .
> > >
> > > You have the same issue with O_DIRECT when using a raw disk device
> > > too.  That is, O_DIRECT on a raw device does not guarantee integrity
> > > in the event of a host crash either, for mostly the same reasons.
> > 
> > QEMU has semantics that use O_DIRECT safely; there is no issue here.
> > When a drive is added with cache=none, QEMU not only uses O_DIRECT but
> > also advertises an enabled write cache to the guest.
> > 
> > The guest *must* flush the cache when it wants to ensure data is
> > stable.  In the event of a host crash, all, some, or none of the I/O
> > since the last flush may have made it to disk.  Each of these
> > possibilities is fair game since the guest may only depend on writes
> > being on disk if they completed and a successful flush was issued
> > afterwards.
> 
> Thank both of you for the explanation, which is very helpful to me. With 
> FVD's capability of eliminating the host file system and storing the image 
> on a logical volume, then perhaps we can always use O_DSYNC, because there 
> is little (or no?) LVM metadata that needs a flush on every write and 
> hence O_DSYNC  does not add overhead? I am not certain on this, and need 
> help for confirmation. If this is true, the guest does not need to flush 
> the cache. 

I think O_DSYNC does not work as you might expect on raw disk devices
and logical volumes.

That doesn't mean you don't need something for crash durability!
Instead, you need to issue the disk cache flushes in whatever way works.

It actually has a very *high* overhead.

The overhead isn't from metadata - it is from needing to flush the
disk cache after every write, which prevents the disk from reordering
writes.

If you don't issue the flushes, and the physical device has a volatile
write cache, then you cannot guarantee integrity in the event of a
host crash.

This can make a filesystem faster than a raw disk or logical volume in
some configurations, if the filesystem journals data writes to limit
the seeking needed to commit durably.

-- Jamie

  parent reply	other threads:[~2011-01-19 23:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 21:44 [Qemu-devel] [RFC] Propose the Fast Virtual Disk (FVD) image format that outperforms QCOW2 by 249% Chunqiang Tang
2011-01-05 17:29 ` Anthony Liguori
2011-01-14 20:56   ` Chunqiang Tang
2011-01-19  1:12     ` Jamie Lokier
2011-01-19  8:10       ` Stefan Hajnoczi
2011-01-19 15:17         ` Chunqiang Tang
2011-01-19 15:25           ` Christoph Hellwig
2011-01-19 23:56           ` Jamie Lokier [this message]
2011-01-19 15:51     ` Christoph Hellwig
2011-01-19 16:21       ` Chunqiang Tang
2011-01-19 16:42         ` Christoph Hellwig
2011-01-19 17:08           ` Chunqiang Tang
2011-01-19 17:25             ` Christoph Hellwig
2011-01-06  9:17 ` Stefan Hajnoczi
2011-01-15  3:28   ` Chunqiang Tang
2011-01-15 17:27     ` Stefan Weil
2011-01-20  2:59       ` Chunqiang Tang
     [not found]     ` <AANLkTinw2S2dzKoeFK-dBP6b36J+VNLjb3f-vbkKm3Fz@mail.gmail.com>
2011-01-17 10:37       ` Stefan Hajnoczi
2011-01-18 20:35         ` Chunqiang Tang
2011-01-19  0:59           ` Jamie Lokier
2011-01-19 14:59             ` Chunqiang Tang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110119235615.GA13494@shareable.org \
    --to=jamie@shareable.org \
    --cc=ctang@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).