diff mbox

block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES

Message ID 1398697893-20585-1-git-send-email-pl@kamp.de
State New
Headers show

Commit Message

Peter Lieven April 28, 2014, 3:11 p.m. UTC
Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block/iscsi.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Stefan Hajnoczi May 6, 2014, 1:01 p.m. UTC | #1
On Mon, Apr 28, 2014 at 05:11:33PM +0200, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
Stefan Hajnoczi May 6, 2014, 1:02 p.m. UTC | #2
On Mon, Apr 28, 2014 at 05:11:33PM +0200, Peter Lieven wrote:
> Signed-off-by: Peter Lieven <pl@kamp.de>
> ---
>  block/iscsi.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)

Oops, I was overzealous applying this patch.  It depends on your earlier
patches.

Paolo: Please take this through scsi-next
Peter Lieven May 6, 2014, 1:13 p.m. UTC | #3
Am 06.05.2014 15:02, schrieb Stefan Hajnoczi:
> On Mon, Apr 28, 2014 at 05:11:33PM +0200, Peter Lieven wrote:
>> Signed-off-by: Peter Lieven <pl@kamp.de>
>> ---
>>  block/iscsi.c |   12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
> Oops, I was overzealous applying this patch.  It depends on your earlier
> patches.
>
> Paolo: Please take this through scsi-next
Paolo already did.

BR,
Peter
diff mbox

Patch

diff --git a/block/iscsi.c b/block/iscsi.c
index 9f5b4a0..eca8a22 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;