All of lore.kernel.org
 help / color / mirror / Atom feed
* initialize max_target_blocked in scsi_alloc_target
@ 2009-04-09 17:02 Edward Goggin
  2009-04-09 17:46 ` Mike Christie
  2009-04-28 19:34 ` Mike Christie
  0 siblings, 2 replies; 3+ messages in thread
From: Edward Goggin @ 2009-04-09 17:02 UTC (permalink / raw)
  To: 'linux-scsi@vger.kernel.org'


Patch 1 of 1

This patch initializes the max_target_blocked field of a scsi target structure
so that a queuecommand return value of SCSI_MLQUEUE_TARGET_BUSY will actually
result in having the scsi_queue_insert blocking the device queue before requeuing
the command and running the queue.  Otherwise, can and does cause livelock on
single CPU configurations if/when open-iSCSI software initiator's command PDU
window fills.

Signed-off-by: Ed Goggin <egoggin@vmware.com>

--- linux-2.6.29/drivers/scsi/scsi_scan.c	2009-03-23 19:12:14.000000000 -0400
+++ linux-2.6.29-fix/drivers/scsi/scsi_scan.c	2009-04-09 11:11:01.000000000 -0400
@@ -427,6 +427,7 @@ static struct scsi_target *scsi_alloc_ta
 	INIT_LIST_HEAD(&starget->devices);
 	starget->state = STARGET_CREATED;
 	starget->scsi_level = SCSI_2;
+	starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED;
  retry:
 	spin_lock_irqsave(shost->host_lock, flags);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: initialize max_target_blocked in scsi_alloc_target
  2009-04-09 17:02 initialize max_target_blocked in scsi_alloc_target Edward Goggin
@ 2009-04-09 17:46 ` Mike Christie
  2009-04-28 19:34 ` Mike Christie
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2009-04-09 17:46 UTC (permalink / raw)
  To: Edward Goggin; +Cc: 'linux-scsi@vger.kernel.org'

Edward Goggin wrote:
> Patch 1 of 1
> 
> This patch initializes the max_target_blocked field of a scsi target structure
> so that a queuecommand return value of SCSI_MLQUEUE_TARGET_BUSY will actually
> result in having the scsi_queue_insert blocking the device queue before requeuing
> the command and running the queue.  Otherwise, can and does cause livelock on
> single CPU configurations if/when open-iSCSI software initiator's command PDU
> window fills.
> 
> Signed-off-by: Ed Goggin <egoggin@vmware.com>
> 
> --- linux-2.6.29/drivers/scsi/scsi_scan.c	2009-03-23 19:12:14.000000000 -0400
> +++ linux-2.6.29-fix/drivers/scsi/scsi_scan.c	2009-04-09 11:11:01.000000000 -0400
> @@ -427,6 +427,7 @@ static struct scsi_target *scsi_alloc_ta
>  	INIT_LIST_HEAD(&starget->devices);
>  	starget->state = STARGET_CREATED;
>  	starget->scsi_level = SCSI_2;
> +	starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED;
>   retry:
>  	spin_lock_irqsave(shost->host_lock, flags);
> 

Thanks for finding this.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: initialize max_target_blocked in scsi_alloc_target
  2009-04-09 17:02 initialize max_target_blocked in scsi_alloc_target Edward Goggin
  2009-04-09 17:46 ` Mike Christie
@ 2009-04-28 19:34 ` Mike Christie
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Christie @ 2009-04-28 19:34 UTC (permalink / raw)
  To: Edward Goggin; +Cc: 'linux-scsi@vger.kernel.org'

Edward Goggin wrote:
> Patch 1 of 1
> 
> This patch initializes the max_target_blocked field of a scsi target structure
> so that a queuecommand return value of SCSI_MLQUEUE_TARGET_BUSY will actually
> result in having the scsi_queue_insert blocking the device queue before requeuing
> the command and running the queue.  Otherwise, can and does cause livelock on
> single CPU configurations if/when open-iSCSI software initiator's command PDU
> window fills.
> 
> Signed-off-by: Ed Goggin <egoggin@vmware.com>
> 
> --- linux-2.6.29/drivers/scsi/scsi_scan.c	2009-03-23 19:12:14.000000000 -0400
> +++ linux-2.6.29-fix/drivers/scsi/scsi_scan.c	2009-04-09 11:11:01.000000000 -0400
> @@ -427,6 +427,7 @@ static struct scsi_target *scsi_alloc_ta
>  	INIT_LIST_HEAD(&starget->devices);
>  	starget->state = STARGET_CREATED;
>  	starget->scsi_level = SCSI_2;
> +	starget->max_target_blocked = SCSI_DEFAULT_TARGET_BLOCKED;
>   retry:
>  	spin_lock_irqsave(shost->host_lock, flags);
> 

Hi James,

I see you picked up my patch to fix the q lock not being held:
http://marc.info/?l=linux-scsi&m=123931064705280&w=2

I think you need Ed's patch above too. Without it, target_blocked is 
always zero, so we never hit the code I fixed up. I tested his patch 
with my patch, and combined they fix all the issues here.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-28 19:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-09 17:02 initialize max_target_blocked in scsi_alloc_target Edward Goggin
2009-04-09 17:46 ` Mike Christie
2009-04-28 19:34 ` Mike Christie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.