linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Evers <revers@redhat.com>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 3/3 V2] alua: backoff alua rtpg retry linearly vs. geometrically
Date: Fri, 18 May 2012 14:08:56 -0400	[thread overview]
Message-ID: <1337364536-6425-4-git-send-email-revers@redhat.com> (raw)
In-Reply-To: <1337364536-6425-1-git-send-email-revers@redhat.com>

Currently the backoff algorithm for when to retry alua rtpg
requests progresses geometrically as so:

2, 4, 8, 16, 32, 64... seconds.

This progression can lead to un-needed delay in retrying
alua rtpg requests when the rtpgs are delayed.  A less
aggressive backoff algorithm that is additive would not
lead to such large jumps when delays start getting long, but
would backoff linearly:

2, 4, 6, 8, 10... seconds.

Signed-off-by: Martin George <marting@netapp.com>
Signed-off-by: Rob Evers <revers@redhat.com>
---
 drivers/scsi/device_handler/scsi_dh_alua.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 51d8cf6..7eb9dea 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -522,7 +522,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
 	unsigned char *ucp;
 	unsigned err;
 	bool rtpg_ext_hdr_req = 1;
-	unsigned long expiry, interval = 1000;
+	unsigned long expiry, interval = 0;
 	unsigned int tpg_desc_tbl_off;
 	unsigned char orig_transition_tmo;
 
@@ -625,7 +625,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
 	case TPGS_STATE_TRANSITIONING:
 		if (time_before(jiffies, expiry)) {
 			/* State transition, retry */
-			interval *= 2;
+			interval += 2000;
 			msleep(interval);
 			goto retry;
 		}
-- 
1.7.7.2


  parent reply	other threads:[~2012-05-18 18:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 18:08 [PATCH 0/3 V2] alua updates Rob Evers
2012-05-18 18:08 ` [PATCH 1/3 V2] alua: implement 'implied transition timeout' Rob Evers
2012-05-18 18:17   ` Moger, Babu
2012-05-18 18:08 ` [PATCH 2/3 V2] alua: retry alua rtpg extended header for illegal request response Rob Evers
2012-05-18 18:19   ` Moger, Babu
2012-05-18 18:08 ` Rob Evers [this message]
2012-05-18 18:19   ` [PATCH 3/3 V2] alua: backoff alua rtpg retry linearly vs. geometrically Moger, Babu
2012-06-05 16:38 ` [PATCH 0/3 V2] alua updates Rob Evers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337364536-6425-4-git-send-email-revers@redhat.com \
    --to=revers@redhat.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).