[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHEC
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES |
Date: |
Fri, 16 May 2014 12:37:42 +0200 |
From: Peter Lieven <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
block/iscsi.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 6b8a0a3..e8d26bb 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -95,7 +95,15 @@ typedef struct IscsiAIOCB {
#define NOP_INTERVAL 5000
#define MAX_NOP_FAILURES 3
#define ISCSI_CMD_RETRIES 5
-#define ISCSI_CHECKALLOC_THRES 63
+
+/* this threshhold is a trade-off knob to choose between
+ * the potential additional overhead of an extra GET_LBA_STATUS request
+ * vs. unnecessarily reading a lot of zero sectors over the wire.
+ * If a read request is greater or equal than ISCSI_CHECKALLOC_THRES
+ * sectors we check the allocation status of the area covered by the
+ * request first if the allocationmap indicates that the area might be
+ * unallocated. */
+#define ISCSI_CHECKALLOC_THRES 64
static void
iscsi_bh_cb(void *p)
@@ -505,7 +513,7 @@ static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
}
#if defined(LIBISCSI_FEATURE_IOVECTOR)
- if (iscsilun->lbprz && nb_sectors > ISCSI_CHECKALLOC_THRES &&
+ if (iscsilun->lbprz && nb_sectors >= ISCSI_CHECKALLOC_THRES &&
!iscsi_allocationmap_is_allocated(iscsilun, sector_num, nb_sectors)) {
int64_t ret;
int pnum;
--
1.8.3.1
- [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 03/11] megasas: Implement LD_LIST_QUERY, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 01/11] scsi-disk: Improve error messager if can't get version number, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 04/11] megasas: Enable MSI-X support, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 05/11] megasas: Add MSI support, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 02/11] scsi: Improve error messages more, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 06/11] MAINTAINERS: mark megasas as maintained, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 07/11] block/iscsi: allow fall back to WRITE SAME without UNMAP, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 08/11] block/iscsi: speed up read for unallocated sectors, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 09/11] block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES,
Paolo Bonzini <=
- [Qemu-devel] [PULL 10/11] block/iscsi: allow cluster_size of 4K and greater, Paolo Bonzini, 2014/05/16
- [Qemu-devel] [PULL 11/11] [PATCH] block/iscsi: bump year in copyright notice, Paolo Bonzini, 2014/05/16
- Re: [Qemu-devel] [PULL 00/11] SCSI changes for 2014-05-15, Peter Maydell, 2014/05/19