From patchwork Mon Jun 13 09:53:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9172493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 919B56075D for ; Mon, 13 Jun 2016 09:54:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81D8F21C9A for ; Mon, 13 Jun 2016 09:54:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76B8022473; Mon, 13 Jun 2016 09:54:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2434221C9A for ; Mon, 13 Jun 2016 09:54:23 +0000 (UTC) Received: from localhost ([::1]:54858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCOZa-0006xr-Ak for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 Jun 2016 05:54:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCOZ6-0006vE-RU for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCOZ4-0004c9-Qq for qemu-devel@nongnu.org; Mon, 13 Jun 2016 05:53:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCOYz-0004bN-BF; Mon, 13 Jun 2016 05:53:45 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9914A8E25B; Mon, 13 Jun 2016 09:53:44 +0000 (UTC) Received: from [10.36.112.17] (ovpn-112-17.ams2.redhat.com [10.36.112.17]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5D9reUR004325 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Jun 2016 05:53:42 -0400 To: Peter Lieven , Eric Blake , qemu-block@nongnu.org References: <1464079240-24362-1-git-send-email-pl@kamp.de> <5744DF5F.3070600@redhat.com> <574BDEA0.2040708@kamp.de> From: Paolo Bonzini Message-ID: <71c8729a-da21-fe2a-0ddf-82595ecfe28c@redhat.com> Date: Mon, 13 Jun 2016 11:53:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <574BDEA0.2040708@kamp.de> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 13 Jun 2016 09:53:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH V3] block/iscsi: allow caching of the allocation map X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: famz@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 30/05/2016 08:33, Peter Lieven wrote: > > The idea of the allocmap in cache.direct = on mode is that we can > still speed up block jobs by skipping large unallocated areas. In this case > the allocmap has only a hint character. If we don't know the status > we issue a get_block_status request and verify the status. If its > unallocated > we return zeroes. If we new through an earlier get block status request > that the area is allocated we can skip the useless get_block_status > request. > This is the old behaviour without this patch. I'm adding a note like this: Paolo diff --git a/block/iscsi.c b/block/iscsi.c index fa03028..299b23c 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -523,6 +523,9 @@ static void iscsi_allocmap_set_unallocated(IscsiLun *iscsilun, int64_t sector_num, int nb_sectors) { + /* Note: if cache.direct=on the third argument to iscsi_allocmap_update + * is ignored, so this will in effect be an iscsi_allocmap_set_invalid. + */ iscsi_allocmap_update(iscsilun, sector_num, nb_sectors, false, true); }