From: Virtbie <virtbie@shiftmail.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Is cache=writeback safe yet?
Date: Mon, 20 Feb 2012 15:18:43 +0100 [thread overview]
Message-ID: <4F425643.2@shiftmail.org> (raw)
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.
In particular with virtio-blk on bare LVM device.
Qemu manpage still says cache=writeback isn't safe, but I seem to find
some discordant information reading around.
Is the WCE+volatile flag exposed to the guest already? I am logging into
a 2.6.38 guest and trying to find an indicator of disk cache in
/sys/block/vda/device but I am not able to. There is an obscure very
long "features" bitmask which I don't know what it shows. I think this
mode is not safe until WBC is exposed, AFAIU, right?
Also please have a look at this:
https://events.linuxfoundation.org/slides/2011/linuxcon-japan/lcj2011_hajnoczi.pdf
page "Caching modes in Qemu"
In the table it is written that writeback has "Guest disk write cache = on".
Does that mean that the guest can commit to real platters by issuing a
flush on the virtual device?
So the problem lies in the fact that no guest will ever spontaneously
issue the flush because they don't see a wce=1?
There is another thing I don't understand:
I think I read somewhere that cache=none is safer than cache=writeback.
Is that true? I think that both have a writeback cache, one is in the
physical disks attached to the host, the other is in the host's page
cache, so they should have about the same level of safety. What do you
think?
Lastly, regarding the newly introduced cache=directsync. Do I understand
correctly that it is supposed to be as safe as cache=writeback but also
as slow as cache=writeback, for writes, and in addition it cannot use
the host pagecache for reads, is that correct?
BTW I also wanted to say I very much like the simplification proposed by
Anthony Liguori on 06/29/2011:
> Thinking twice about this, shouldn't we just move to a simplified model:
>
> -drive file=foo.img,cache=[on|off],hd0 -device
> virtio-blk-pci,drive=hd0,wce=1
splitting the cache features in two (host side / guest side) would very
much clarify what is happening in Qemu, for us ignorant users.
Thank you
Vb.
next reply other threads:[~2012-02-20 14:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 14:18 Virtbie [this message]
2012-02-20 15:06 ` [Qemu-devel] Is cache=writeback safe yet? Anthony Liguori
2012-02-20 15:43 ` Virtbie
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=4F425643.2@shiftmail.org \
--to=virtbie@shiftmail.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).