Re: [RFC PATCH 2/4] scsi error: have scsi-ml call change_queue_depth to handle QUEUE_FULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 19, 2009 at 12:52:45AM -0500, michaelc@xxxxxxxxxxx wrote:
> From: Mike Christie <michaelc@xxxxxxxxxxx>
> 
> This has scsi-ml call the change_queue_depth functions when
> we get a QUEUE_FULL. It will only change the queue depth if
> change_queue_depth is set because the LLD may have to
> modify some internal resources, so I thought this would
> be the safest route.
> 
> 
> Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx>
> ---
>  drivers/scsi/scsi_error.c |   26 +++++++++++++++++++++++++-
>  1 files changed, 25 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> index 0c2c73b..792644e 100644
> --- a/drivers/scsi/scsi_error.c
> +++ b/drivers/scsi/scsi_error.c
> @@ -331,6 +331,27 @@ static int scsi_check_sense(struct scsi_cmnd *scmd)
>  	}
>  }
> 
> +static void scsi_handle_queue_full(struct scsi_device *sdev)
> +{
> +	struct scsi_host_template *sht = sdev->host->hostt;
> +	struct scsi_device *tmp_sdev;
> +
> +	if (!sht->change_queue_depth)
> +		return;
> +
> +	shost_for_each_device(tmp_sdev, sdev->host) {
> +		if (tmp_sdev->id != sdev->id)
> +			continue;
> +		/*
> +		 * We do not know the number of commands that were at
> +		 * the device when we got the queue full so we start
> +		 * from the highest possible value and work our way down.
> +		 */
> +		sht->change_queue_depth(tmp_sdev, tmp_sdev->queue_depth - 1,
> +					SCSI_QDEPTH_QFULL);
> +	}
> +}
> +

This was called because of a "queue full" for one SCSI device. Why do
you decrement the queue depth for all SCSI devices on the same host
and not only for one device?

I think the overall approach looks good.

Thanks for working on this,

Christof
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux