Received: from eggs.gnu.org ([2001:4830:134:3::10]:57782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP4IA-0003gk-JA for qemu-devel@nongnu.org; Mon, 18 Jul 2016 04:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bP4I7-0008BQ-DX for qemu-devel@nongnu.org; Mon, 18 Jul 2016 04:52:46 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:46321 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bP4I7-0008As-3B for qemu-devel@nongnu.org; Mon, 18 Jul 2016 04:52:43 -0400 From: Peter Lieven Date: Mon, 18 Jul 2016 10:52:18 +0200 Message-Id: <1468831940-15556-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH V5 0/2] block/iscsi: allow caching of the allocation map List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, kwolf@redhat.com, mreitz@redhat.com, ronniesahlberg@gmail.com, famz@redhat.com, Peter Lieven until now the allocation map was used only as a hint if a cluster is allocated or not. If a block was not allocated (or Qemu had no info about the allocation status) a get_block_status call was issued to check the allocation status and possibly avoid a subsequent read of unallocated sectors. If a block known to be allocated the get_block_status call was omitted. In the other case a get_block_status call was issued before every read to avoid the necessity for a consistent allocation map. To avoid the potential overhead of calling get_block_status for each and every read request this took only place for the bigger requests. This patch enhances this mechanism to cache the allocation status and avoid calling get_block_status for blocks where the allocation status has been queried before. This allows for bypassing the read request even for smaller requests and additionally omits calling get_block_status for known to be unallocated blocks. History: v4->v5: - fix rounding if clusters are expanded [Paolo] - Remove the checking for nb_clusters > 0 as bitmap_set and bitmap_clear can both handle nr == 0. - fixed comment in iscsi_allocmap_set_unallocated (third -> fifth argument) v3->v4: - added comment to iscsi_allocmap_set_unallocated [Paolo] - rebased to current master v2->v3: - fix wording errors [Fam] - reinit allocmap only if allocmap is present in bdrv_reopen_commit v1->v2: - add more comments [Fam] - free allocmap if allocation of allocmap_valid fails [Fam] - fix indent and whitespace errors [Fam] - account for cache mode changes on reopen Peter Lieven (2): block/iscsi: fix rounding in iscsi_allocationmap_set block/iscsi: allow caching of the allocation map block/iscsi.c | 248 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 192 insertions(+), 56 deletions(-) -- 1.9.1