From patchwork Wed Feb 6 12:32:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 218617 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5E3B92C0099 for ; Thu, 7 Feb 2013 00:46:08 +1100 (EST) Received: from localhost ([::1]:38900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U34DS-0000Vf-1i for incoming@patchwork.ozlabs.org; Wed, 06 Feb 2013 07:35:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U34D0-000081-T2 for qemu-devel@nongnu.org; Wed, 06 Feb 2013 07:34:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U34Cr-0005W7-5u for qemu-devel@nongnu.org; Wed, 06 Feb 2013 07:34:38 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:43737 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U34Cq-0005Vp-N9 for qemu-devel@nongnu.org; Wed, 06 Feb 2013 07:34:29 -0500 Received: by paradis.irqsave.net (Postfix, from userid 1002) id 17EAD874326; Wed, 6 Feb 2013 13:34:28 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.77.1]) by paradis.irqsave.net (Postfix) with ESMTP id 7D6E5874344; Wed, 6 Feb 2013 13:31:31 +0100 (CET) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= To: qemu-devel@nongnu.org Date: Wed, 6 Feb 2013 13:32:06 +0100 Message-Id: <1360153939-9563-4-git-send-email-benoit@irqsave.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360153939-9563-1-git-send-email-benoit@irqsave.net> References: <1360153939-9563-1-git-send-email-benoit@irqsave.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 62.212.105.220 Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , stefanha@redhat.com Subject: [Qemu-devel] [RFC V2 03/16] qcow2: Add deduplication metrics structures. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org --- block/qcow2.h | 3 ++- include/block/block.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block/qcow2.h b/block/qcow2.h index 18e2974..fc393d5 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -234,9 +234,10 @@ typedef struct BDRVQcowState { int32_t dedup_table_size; GTree *dedup_tree_by_hash; GTree *dedup_tree_by_sect; + CoMutex dedup_lock; + BlockDeduplicationMetrics dedup_metrics; CoMutex lock; - CoMutex dedup_lock; uint32_t crypt_method; /* current crypt method, 0 if no key yet */ uint32_t crypt_method_header; diff --git a/include/block/block.h b/include/block/block.h index 5c3b911..162f8a9 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -12,6 +12,17 @@ typedef struct BlockDriver BlockDriver; typedef struct BlockJob BlockJob; +typedef struct { + uint64_t deduplicated_clusters; + uint64_t non_deduplicated_clusters; + uint64_t missing_data_reads; /* reads used to complete partials clusters */ + uint64_t ram_hash_creations; /* RAM based lookup */ + uint64_t ram_hash_deletions; /* RAM based lookup */ + uint64_t ram_usage; /* RAM usage in bytes */ + uint64_t deleted_clusters; /* number of deleted clusters */ + uint64_t refcount_overflows; /* number of refcount overflows */ +} BlockDeduplicationMetrics; + typedef struct BlockDriverInfo { /* in bytes, 0 if irrelevant */ int cluster_size;