From: Kevin Wolf <kwolf@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, Virtbie <virtbie@shiftmail.org>
Subject: Re: [Qemu-devel] Is cache=writeback safe yet?
Date: Mon, 20 Feb 2012 16:56:53 +0100 [thread overview]
Message-ID: <4F426D45.9080109@redhat.com> (raw)
In-Reply-To: <CAFEAcA8ytBiNY-Lca61D8=8yM024Z9+bwhLXZuyzjzZNBrY15A@mail.gmail.com>
Am 20.02.2012 16:29, schrieb Peter Maydell:
> On 20 February 2012 15:20, Kevin Wolf <kwolf@redhat.com> wrote:
>> Am 20.02.2012 15:18, schrieb Virtbie:
>>> 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?
>>
>> qemu exposes the WCE flag and if your guest handles it correctly (i.e.
>> it sends flush requests where needed), cache=writeback is safe. This is
>> true for recent Linux versions.
>
> The thing that confuses me when this subject comes up is that "cache=writeback"
> is a property of the block layer, but the WCE flag is a SCSI parameter,
> right? How does this work on non-SCSI disks? Is there something that
> eg hw/sd.c should be doing to tell the block layer "writeback cache is
> safe/unsafe" ?
IDE and virtio-blk have some kind of WCE bit as well.
If your hardware doesn't have it, I think you need to check whether your
hardware never has any write cache or if it always has one (if it
sometimes has one but doesn't expose the information, it's already the
hardware that is broken).
You should probably just fail device creation with an inappropriate
cache option.
Kevin
next prev parent reply other threads:[~2012-02-20 15:53 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
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 [this message]
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=4F426D45.9080109@redhat.com \
--to=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=virtbie@shiftmail.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).