qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/3] block: zero write detection
@ 2011-12-07 12:10 Stefan Hajnoczi
  2011-12-07 12:10 ` [Qemu-devel] [PATCH v2 1/3] block: add zero write detection interface Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-12-07 12:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Marcelo Tosatti, Stefan Hajnoczi

This series adds an interface for optimized writes when data contains all
zeros.  If zero detection is enabled a block driver can take extra steps to
represent zero regions efficiently.

The details of optimized zero representations depend on the image format but
the main block layer change is a field to indicate that zero detection should
be performed.  (This can be CPU intensive since buffers are scanned for all
zeros and the feature is disabled by default.)

This series includes a patch for the QED image format that writes special "zero
clusters" and keeps the image file compact.  In the future qcow2v3 could also
support an efficient zero representation.

My motivation for this feature is efficient image streaming.  The destination
file must stay compact and not be bloated with clusters containing only zeroes
from the source file.

Kevin Wolf <kwolf@redhat.com> has suggested zero detection in the source image
to avoid scanning for zeroes when the source image has an efficient zero
representation.  This is a complementary feature which can be introduced in the
future but does not work for raw files over NFS, for example.  I see the
current series as the minimum support we need with extensions possible in the
future.

Here is a qemu-iotest to verify that zero write detection is working:
http://repo.or.cz/w/qemu-iotests/stefanha.git/commitdiff/226949695eef51bdcdea3e6ce3d7e5a863427f37

Stefan Hajnoczi (3):
  block: add zero write detection interface
  qed: add zero write detection support
  qemu-io: add zero write detection option

 block.c     |   16 ++++++++++++
 block.h     |    3 ++
 block/qed.c |   80 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 block_int.h |    9 ++++++
 qemu-io.c   |   29 ++++++++++++++++-----
 5 files changed, 122 insertions(+), 15 deletions(-)

-- 
1.7.7.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-08 15:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-07 12:10 [Qemu-devel] [PATCH v2 0/3] block: zero write detection Stefan Hajnoczi
2011-12-07 12:10 ` [Qemu-devel] [PATCH v2 1/3] block: add zero write detection interface Stefan Hajnoczi
2011-12-07 12:10 ` [Qemu-devel] [PATCH v2 2/3] qed: add zero write detection support Stefan Hajnoczi
2011-12-08 14:29   ` Mark Wu
2011-12-08 15:54     ` Stefan Hajnoczi
2011-12-07 12:10 ` [Qemu-devel] [PATCH v2 3/3] qemu-io: add zero write detection option Stefan Hajnoczi

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).