QED does not deliver flush on synchronized write
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
At least one flush method should be provided by qed driver (common/co/aio).
I was doing "sync write" benchmarking on varies qemu supported formats (on ssd). I was surprised that QED shows significant high performance over several other formats (qcow2/vmdk/vdi..). In some test cases QED even runs a little bit faster than raw format!
After careful reading of the code I found QED skipped the necessary flush by providing nothing on flush api. unlike read/write which require at least one type of implementation, flush API is not mandatory because your format could guarantee that synchronization is done in write path or others. However that's not the case in QED because data is buffered in the "bs->file" and QED needs to propagate the flush command to it to make data safe.
However I'm not a skilled qemu developer. Above is what I got from my thinking and study. Please correct me if in any way I misunderstood the design. I really appreciate!
The patch is short:
https:/
qemu release version: 2.1.0. But this should have been there for a long time.
The patch is based on this recent commit:
69f87f713069f1f
Thanks.
On Wed, Aug 06, 2014 at 03:32:29PM -0000, Nybble wrote:
> ** Changed in: qemu
> Status: New => Invalid
I guess you saw that bdrv_co_flush() calls bdrv_co_ flush(bs- >file). co_flush_ to_disk( ) will have fdatasync() called on their image
This means that even block drivers that do not provide
->bdrv_
file.
Stefan