qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qcow2 - safe on kill?  safe on power fail?
Date: Tue, 22 Jul 2008 15:46:46 +0100	[thread overview]
Message-ID: <20080722144646.GD20829@shareable.org> (raw)
In-Reply-To: <4885E9C2.9080209@codemonkey.ws>

Anthony Liguori wrote:
> >What about SCSI or SATA NCQ?  On these, barriers don't impact 
> >performance greatly.
> 
> Good question, I don't know the answer.  But ext3 doesn't autodetect 
> SCSI/NCQ or anything.  It disabled barriers by default.  Some distros 
> have changed this behavior historically (SLES I believe).

Also don't forget XFS, Reiserfs.  I think they both use barriers by
default and have a correct fsync too.

SCSI/NCQ are detected by the block layer, as long as the filesystem
uses barriers.  Oh, and as long as not using LVM which doesn't pass on
barriers :/

> >>This is very hard to see happen in practice though because these 
> >>windows are very small--just like with QEMU.
>
> >The exposure window with qemu is not small.  It's as large as the page 
> >cache of the host.
> 
> Note I was careful to qualify my statements that cache=off was required.

Fair point.  Unfortunately cache=off introduces other exposure windows.

With cache=on, the multiple block writes to allocate a qcow2 sector
are in fast succession, so a QEMU crash (or signal) has to happen
during this short interval.

With cache=off, those writes will take as long as the disk seeks
between them, so there's a longer time window for a QEMU crash to
corrupt the file.

Also with cache=off, there's no disk barriers on any filesystem and
any filesystem options, so there's the additional time window of disk
cache inconsistency with the platters.

Databases face the same problem on Linux, but it's often ignored.
Does anyone know what Oracle on Linux does to keep it's structures
robust?

-- Jamie

  reply	other threads:[~2008-07-22 14:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 21:18 [Qemu-devel] Signal handling and qcow2 image corruption David Barrett
2008-03-05 21:55 ` Anthony Liguori
2008-03-05 23:48   ` David Barrett
2008-03-06  6:57   ` Avi Kivity
2008-07-21 18:10   ` [Qemu-devel] qcow2 - safe on kill? safe on power fail? Jamie Lokier
2008-07-21 19:43     ` Anthony Liguori
2008-07-21 21:26       ` Jamie Lokier
2008-07-21 22:14         ` Anthony Liguori
2008-07-21 23:47           ` Jamie Lokier
2008-07-22  6:06           ` Avi Kivity
2008-07-22 14:08             ` Anthony Liguori
2008-07-22 14:46               ` Jamie Lokier [this message]
2008-07-22 19:11               ` Avi Kivity
2008-07-22 14:32             ` Jamie Lokier
2008-07-21 22:00       ` Andreas Schwab
2008-07-21 22:15         ` Anthony Liguori
2008-07-21 22:22           ` David Barrett
2008-07-21 22:50             ` Anthony Liguori
2008-07-22  6:07           ` Avi Kivity
2008-07-22 14:11             ` Anthony Liguori
2008-07-22 14:36               ` Avi Kivity
2008-07-22 16:16                 ` Jamie Lokier
2008-07-22 19:13                   ` Avi Kivity
2008-07-22 20:04                     ` Jamie Lokier
2008-07-22 21:25                       ` Avi Kivity
2008-07-22 14:22             ` Jamie Lokier

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=20080722144646.GD20829@shareable.org \
    --to=jamie@shareable.org \
    --cc=qemu-devel@nongnu.org \
    /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).