qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Is cache=writeback safe yet?


From: Kevin Wolf
Subject: Re: [Qemu-devel] Is cache=writeback safe yet?
Date: Mon, 20 Feb 2012 16:56:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0

Am 20.02.2012 16:29, schrieb Peter Maydell:
> On 20 February 2012 15:20, Kevin Wolf <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]