Bug 714798

Summary: [6.2 Feat] scsi lock pushdown backport
Product: Red Hat Enterprise Linux 6 Reporter: Rob Evers <revers>
Component: kernelAssignee: Red Hat Kernel Manager <kernel-mgr>
Status: CLOSED WONTFIX QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.1CC: rwheeler, thenzl
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-18 18:56:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
lock-pushdown scsi mid-layer backport
none
rhel6 backport of scsi-ml lockless queuecommand dispatch
none
scsi ml error handling lock pushdown none

Description Rob Evers 2011-06-20 19:29:15 UTC
Description of problem:

Backport of scsi midlayer lock pushdown.  Backport required to maintain binary compatibility.  This allows scsi subsystems to indicate to the scsi midlayer that the subsystem queuecommand should be called without the scsi host lock
being held.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Rob Evers 2011-06-20 19:34:16 UTC
Created attachment 505681 [details]
lock-pushdown scsi mid-layer backport

Comment 4 Rob Evers 2011-06-21 18:21:54 UTC
The scsi midlayer supports optional lockless dispatching of scsi driver
queuecommand functions as of rhel6.2 - beta.

This is a backport of the upstream scsi lock pushdown commit.  The backport
retains binary compatibility with rhel6.0 and rhel6.1.  Retaining binary
compatibility requires divergence from the equivalent upstream scsi lock
pushdown mechanism.

A previously un-used flag in the scsi_host_template structure is used by scsi
drivers to indicate to the scsi midlayer that driver queuecommand will be
dispatched without the scsi host bus lock held.  This bit is copied into
another previously un-used bit in the Scsi_Host structure.

The default behavior is that the Scsi_Host lock will be held during driver
queuecommand dispatch.  Setting the scsi_host_template lockless bit prior to
scsi_host_alloc will cause the driver queuecommand function to be dispatched
without the Scsi_Host lock being held.  In this case, the responsibility for
any lock protection required is "pushed down" into the driver queuecommand code
path.

Comment 5 Rob Evers 2011-06-22 15:51:20 UTC
For drivers to request that the scsi midlayer call the driver's queuecommand with the Scsi_Host lock not held, the driver must set the scsi_host_template's lockless bit before the scsi_host_template is passed to scsi_host_alloc.

ie:

+ sht->lockless = 1;
scsi_host_alloc(sht, size);

Comment 6 Rob Evers 2011-06-24 11:42:03 UTC
(In reply to comment #5)
> For drivers to request that the scsi midlayer call the driver's queuecommand
> with the Scsi_Host lock not held, the driver must set the scsi_host_template's
> lockless bit before the scsi_host_template is passed to scsi_host_alloc.
> 
> ie:
> 
> + sht->lockless = 1;
> scsi_host_alloc(sht, size);

Apply https://bugzilla.redhat.com/attachment.cgi?id=505681 before enabling lockless queuecommand callback.

Also ensure locking mechanisms are in place to replace the host bus lock mechanism that this removes.  This is driver specific.

Comment 7 Rob Evers 2011-06-24 21:16:46 UTC
Created attachment 509845 [details]
rhel6 backport of scsi-ml lockless queuecommand dispatch

Comment 8 Rob Evers 2011-06-24 21:17:49 UTC
(In reply to comment #1)
> Created attachment 505681 [details]
> lock-pushdown scsi mid-layer backport

See updated attachment:

https://bugzilla.redhat.com/attachment.cgi?id=509845

Comment 9 Rob Evers 2011-07-14 14:49:23 UTC
Created attachment 513203 [details]
scsi ml error handling lock pushdown

This case of queuecommand dispatch was missed.  Adding equivalent unlocking.

Comment 10 RHEL Program Management 2011-10-07 15:38:16 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.