Skip to content

Commit

Permalink
[SCSI] scsi_dh_alua: backoff alua rtpg retry linearly vs. geometrically
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Babu Moger <babu.moger@netapp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Rob Evers authored and James Bottomley committed Jul 20, 2012
1 parent 8e67ce6 commit bc97f4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/device_handler/scsi_dh_alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,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;

Expand Down Expand Up @@ -632,7 +632,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;
}
Expand Down

0 comments on commit bc97f4b

Please sign in to comment.