[pve-devel] Default cache mode for VM hard drives
ginermail at gmail.com
Thu May 28 15:32:07 CEST 2015
On Thu, May 28, 2015 at 4:17 PM, Eneko Lacunza <elacunza at binovo.es> wrote:
> On 28/05/15 15:01, Stanislav German-Evtushenko wrote:
>>> Note that without O_DIRECT you won't get a "correct" result either; disk
>>> may end not containing the data in the buffer when write was called.
>>> Softmirror data will be identically uncertain :)
>> You are right. That is why I suppose there is a bug (operations with
>> buffer are not ensured to be thread-safe) in QEMU-KVM.
> What does it mean that operations with buffer are not ensured to be
> thread-safe in qemu?
> O_DIRECT doesn't guarantee that buffer reading is finished when write
> returns if I read "man -s 2 open" correctly.
The statement seems to be not correct.
O_DIRECT does not guarantee that data reaches the undererying hardware
on return but it does guarantee that reading from buffer is finished.
Consinder the following examples.
This is okay:
This is not okay and this is what is actually happening:
2. change_buffer (we can do this only in another thread)
6. change_buffer (we can do this only in another thread)
More information about the pve-devel