[Top][All Lists]

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

[Qemu-devel] [PATCH v2 0/3] block: zero write detection

From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH v2 0/3] block: zero write detection
Date: Wed, 7 Dec 2011 12:10:56 +0000

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 <address@hidden> 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

Here is a qemu-iotest to verify that zero write detection is working:

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


reply via email to

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