From: "andrzej zaborowski" <balrog@zabor.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk
Date: Mon, 31 Jul 2006 11:52:45 +0200 [thread overview]
Message-ID: <fb249edb0607310252v233ee6f2tee6883a3d3393d3a@mail.gmail.com> (raw)
In-Reply-To: <20060730214147.GA6255@mail.shareable.org>
On 30/07/06, Jamie Lokier <jamie@shareable.org> wrote:
> Rik van Riel wrote:
> > This may look like hair splitting, but so far I've lost a
> > (test) postgresql database to this 3 times already. Not getting
> > the guest application's data to disk when the application calls
> > fsync is a recipe for disaster.
>
> Exactly the same thing happens with real IDE disks if IDE write
> caching (on the drive itself) is enabled, which it is by default. It
> is rarer, but it happens.
The little difference with QEMU is that there are two caches above it:
the host OS'es software cache and the IDE hardware cache. When a guest
OS flushes its own software cache its precious data goes to the host's
software cache while the guest thinks it's already the IDE cache. This
is ofcourse of less importance because data in both caches (hard- and
software) is lost when the power is cut off.
IMHO what really makes IO unreliable in QEMU is that IO errors on the
host are not reported to the guest by the IDE emulation and there's an
exact place in hw/ide.c where they are arrogantly ignored.
>
> I've seen this with Linux 2.4 kernels writing to ext3 (real, not
> virtual). Filesystem metadata gets corrupted from time to time if
> power is removed, because write ordering is not preserved. Disabling
> IDE write caching fixes it, but the performance impact is huge on some
> systems.
>
> Linux 2.6 kernels will issue IDE cache flush commands, at least with
> ext3, to commit data to disk when fsync is called, and to preserve
> journal/metadata ordering.
>
> Doesn't qemu fsync the host file corresponding to the emulated disk,
> when the guest OS issues an IDE cache flush?
>
> For IDE emulation to be as reliable for data storage as a real disk,
> it should:
>
> - fsync the host file whenever the guest OS issues an IDE cache
> flush command.
>
> - use O_SYNC (or fsync after each write or aio equivalent, etc.) _only_
> when the guest OS disables the IDE disk cache (not done by default).
>
> -- JAmie
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
balrog 2oo6
Dear Outlook users: Please remove me from your address books
http://www.newsforge.com/article.pl?sid=03/08/21/143258
next prev parent reply other threads:[~2006-07-31 9:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-28 19:54 [Qemu-devel] [RFC][PATCH] make sure disk writes actually hit disk Rik van Riel
2006-07-28 19:58 ` [Qemu-devel] " Rik van Riel
2006-07-28 20:12 ` Anthony Liguori
2006-07-28 20:18 ` Rik van Riel
2006-07-28 20:30 ` Paul Brook
2006-07-28 20:43 ` Rik van Riel
2006-07-28 21:01 ` Paul Brook
2006-07-31 7:08 ` Jens Axboe
2006-07-29 9:57 ` [Qemu-devel] " Fabrice Bellard
2006-07-29 14:59 ` Rik van Riel
2006-07-29 16:04 ` Paul Brook
2006-07-29 16:22 ` Rik van Riel
2006-07-29 16:31 ` Paul Brook
2006-07-31 7:08 ` Jens Axboe
2006-07-29 17:33 ` Bill C. Riemers
2006-07-30 21:47 ` Jamie Lokier
2006-07-30 21:41 ` Jamie Lokier
2006-07-31 9:52 ` andrzej zaborowski [this message]
2006-07-31 10:17 ` Jens Axboe
2006-07-31 17:50 ` andrzej zaborowski
2006-07-31 7:08 ` Jens Axboe
2006-07-31 7:56 ` Jonas Maebe
2006-07-31 8:18 ` Jens Axboe
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=fb249edb0607310252v233ee6f2tee6883a3d3393d3a@mail.gmail.com \
--to=balrog@zabor.org \
--cc=balrogg@gmail.com \
--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).