From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYGL9-0002Vf-CV for qemu-devel@nongnu.org; Wed, 07 Dec 2011 07:11:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYGL8-0005JF-0O for qemu-devel@nongnu.org; Wed, 07 Dec 2011 07:11:11 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:50984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYGL7-0005Ib-OJ for qemu-devel@nongnu.org; Wed, 07 Dec 2011 07:11:09 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Dec 2011 12:11:07 -0000 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pB7CB3UF2756624 for ; Wed, 7 Dec 2011 12:11:03 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pB7CAt6n018173 for ; Wed, 7 Dec 2011 05:10:55 -0700 From: Stefan Hajnoczi Date: Wed, 7 Dec 2011 12:10:56 +0000 Message-Id: <1323259859-8709-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 0/3] block: zero write detection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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