From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VkxgB-0005Jc-Py for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:02:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vkxg6-000114-BJ for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:02:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vkxg6-00010p-2T for qemu-devel@nongnu.org; Mon, 25 Nov 2013 10:02:22 -0500 Message-ID: <52936674.6010303@redhat.com> Date: Mon, 25 Nov 2013 16:02:12 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385387840-17307-1-git-send-email-pl@kamp.de> <1385387840-17307-5-git-send-email-pl@kamp.de> In-Reply-To: <1385387840-17307-5-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.8 4/6] block/iscsi: set bdi->cluster_size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 25/11/2013 14:57, Peter Lieven ha scritto: > this patch aims to set bdi->cluster_size to the internal page size > of the iscsi target so that enabled callers can align requests > properly. > > Signed-off-by: Peter Lieven > --- > block/iscsi.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/block/iscsi.c b/block/iscsi.c > index 93fee6d..75d6b87 100644 > --- a/block/iscsi.c > +++ b/block/iscsi.c > @@ -1580,6 +1580,13 @@ static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) > IscsiLun *iscsilun = bs->opaque; > bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz; > bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws; > + /* Guess the internal cluster (page) size of the iscsi target by the means > + * of opt_unmap_gran. Transfer the unmap granularity only if it has a > + * reasonable size for bdi->cluster_size */ > + if (iscsilun->bl.opt_unmap_gran * iscsilun->block_size >= 64 * 1024 && > + iscsilun->bl.opt_unmap_gran * iscsilun->block_size <= 16 * 1024 * 1024) { > + bdi->cluster_size = iscsilun->bl.opt_unmap_gran * iscsilun->block_size; > + } > return 0; > } > > After looking at patch 5, I think this one is correct. Reviewed-by: Paolo Bonzini but I think you should make higher layers (qcow2) use the lower BDS's granularity, at least as a default. Paolo