From: Virtbie <virtbie@shiftmail.org>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Is cache=writeback safe yet?
Date: Mon, 20 Feb 2012 16:43:18 +0100 [thread overview]
Message-ID: <4F426A16.9090609@shiftmail.org> (raw)
In-Reply-To: <4F42616D.30800@codemonkey.ws>
On 02/20/12 16:06, Anthony Liguori wrote:
> On 02/20/2012 08:18 AM, Virtbie wrote:
>> Dear qemuers,
>> thanks for your exellent software.
>>
>> I would like to use cache=writeback, but I still can't understand if
>> this is
>> safe or not in case of power loss.
>
> "Safe" is too simplistic of a view. The documentation in
> qemu-options.hx probably needs to be revisited.
>
> cache=writeback emulates a large disk cache much the same as every
> modern hard drive has a builtin cache.
>
> The only real difference is that the host cache is very, very large.
> Some modern file systems did not take the necessary steps to ensure
> consistency when a volatile write cache is present (ext3 up until very
> recently when barrier=1 became default).
>
> In practice, this didn't create a huge issue because disk write caches
> are flushed often. Ted T'so has written a lot about the practical
> bits here.
>
> But since the host cache is very large, and may not be flushed for
> many minutes after the initial write, this can exacerbate the problem.
>
> In short, if you're using a recent kernel with ext3 or ext4,
> cache=writeback is absolutely safe. If you're using an older version
> of ext3, cache=writeback is still safe but ext3 itself isn't.
> cache=writeback can make the situation worse.
>
> cache=writethrough presents a non-volatile cache which makes even
> older ext3 filesystems safe.
>
> Regards,
>
> Anthony Liguori
Great explanation Anthony,
may I still ask:
1)
Is WCE + volatile flag exposed to the guest, by all three virtual devices:
- virtio
- scsi
- ide
?
(if not, I still don't understand how this works)
2) Is there a minimum guest kernel and a minimum viostor Windows driver
version, to see such WCE+volatile flag in a virtio disk, so that the
guest OS can actually see the cache?
Because I can't seem to find such flag for a virtio disk on a linux
2.6.38 guest and that seems serious to me.
Is it visible somewhere in /sys hierarchy? Or is 2.6.38 too old?
Thank you
Vb.
next prev parent reply other threads:[~2012-02-20 15:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 14:18 [Qemu-devel] Is cache=writeback safe yet? Virtbie
2012-02-20 15:06 ` Anthony Liguori
2012-02-20 15:43 ` Virtbie [this message]
2012-02-20 17:52 ` Virtbie
2012-02-20 15:20 ` Kevin Wolf
2012-02-20 15:29 ` Peter Maydell
2012-02-20 15:56 ` Kevin Wolf
2012-02-20 16:08 ` Peter Maydell
2012-02-20 17:03 ` Paolo Bonzini
2012-02-20 17:10 ` Peter Maydell
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=4F426A16.9090609@shiftmail.org \
--to=virtbie@shiftmail.org \
--cc=anthony@codemonkey.ws \
--cc=kwolf@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.