qemu-discuss
[Top][All Lists]
Advanced

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

Re: [Qemu-discuss]  qcow2 performanceimprove 


From: Alberto Garcia
Subject: Re: [Qemu-discuss]  qcow2 performanceimprove 
Date: Fri, 17 Aug 2018 11:12:55 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Aug 17, 2018 at 10:28:49AM +0800, address@hidden wrote:

> > > > If there is no backing file or snapshot you still need to fill
> > > > the cluster with zeroes, and that's going to be slower with
> > > > larger clusters.
> > > If not fill zeroes and only write guest data ,what`s wrong could
> > > happen ?
> > The following could happen:
> > 1) Guest reads at offset  [0,   4k] -> there's only zeroes
> > 2) Guest writes at offset [8k, 16k]
> > 3) Guest reads at offset  [0,   4k] -> there's something else now

> Why could guest read the area at offset [0, 4k] has not be writen
> yet ?

Jakob already gave you some answers, but here's a simple one: because
it might have already been written.

If the guest wrote zeroes to [0, 1M] you can't generally assume that
there's an allocated 1MB cluster on the qcow2 file filled with zeroes.

 - QEMU can detect that the guest tried to write zeroes and decide to
   leave the cluster unallocated (see for example the "detect_zeroes"
   option, or the "WRITE SAME" SCSI command).
 - The qcow2 file could have been converted at some point, and
   zero-filled clusters could have been deallocated for efficiency.

Berto



reply via email to

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