scsi, mptsas : drop scsi_host lock when calling mptsas_qcmd
Subsystems (2)
PATCH 1/1 scsi, mptsas : drop scsi_host lock when calling mptsas_qcmd
During testing of FFSB benchmark (configured with
128 threaded write to 128 files on 16 SSD), scsi_host lock was
heavily contended, accounting for 23.7% of cpu cycles. There
are 64 cores in our test system and the JBOD
is connected with a mptsas HBA. Taking a similar approach
as the patch by Vasu (http://permalink.gmane.org/gmane.linux.scsi.open-fcoe.devel/10110)
for Fiber Channel adapter, the following patch on 2.6.35 kernel
avoids taking the scsi host lock when queueing mptsas scsi command. We see a big drop in the cpu cycles contending for the lock (from 23.7% to 1.8%). The number of IO per sec increase by 10.6% from 62.9K per sec to 69.6K per sec.
If there is no good reason to prevent mptsas_qcmd from being executed in parallel, we should remove this lock from the queue command code path. Other adapters probably can benefit in a similar manner.
%cpu cycles contending host lock
2.6.35 2.6.35+patch
-----------------------------------------------------
scsi_dispatch_cmd 5.5% 0.44% scsi_device_unbusy 6.1% 0.66% scsi_request_fn 6.6% 0.35% scsi_run_queue 5.5% 0.35%
Tim Chen
drivers/message/fusion/mptsas.c +2 -0
@@ -4984,6 +4984,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) sh->max_lun = max_lun; sh->transportt = mptsas_transport_template; + sh->unlocked_qcmds =1 ; +/* Required entry. */ sh->unique_id = ioc->id;
drivers/scsi/scsi.c +6 -1
@@ -749,11 +749,16 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)if (unlikely (host->shost_state ==SHOST_DEL )) { cmd->result = (DID_NO_CONNECT <<16 );scsi_done (cmd); +spin_unlock_irqrestore (host->host_lock, flags); }else {trace_scsi_dispatch_cmd_start (cmd); +if (host->unlocked_qcmds) +spin_unlock_irqrestore (host->host_lock, flags); rtn = host->hostt->queuecommand (cmd, scsi_done); +if (!host->unlocked_qcmds) +spin_unlock_irqrestore (host->host_lock, flags); } -spin_unlock_irqrestore (host->host_lock, flags); +if (rtn) {trace_scsi_dispatch_cmd_error (cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&
include/scsi/scsi_host.h +3 -0
@@ -636,6 +636,9 @@ struct Scsi_Host {/* Asynchronous scan in progress */ unsigned async_scan:1; +/* call queuecommand without Scsi_Host lock held */ + unsigned unlocked_qcmds:1; +/* * Optional work queue to be utilized by the transport */
Quoted 17 lines · Tim Chen
During testing of FFSB benchmark (configured with
128 threaded write to 128 files on 16 SSD),scsi_hostlock was
heavily contended, accounting for 23.7% of cpu cycles. There
are 64 cores in our test system and the JBOD
is connected with a mptsas HBA. Taking a similar approach
as the patch by Vasu (http://permalink.gmane.org/gmane.linux.scsi.open-fcoe.devel/10110)
for Fiber Channel adapter, the following patch on 2.6.35 kernel
avoids taking the scsi host lock when queueing mptsas scsi command. We see a big drop in the cpu cycles contending for the lock (from 23.7% to 1.8%). The number of IO per sec increase by 10.6% from 62.9K per sec to 69.6K per sec.If there is no good reason to prevent
mptsas_qcmdfrom being executed in parallel, we should remove this lock from the queue command code path. Other adapters probably can benefit in a similar manner.
Quoted 9 lines
%cpu cycles contending host lock
2.6.35 2.6.35+patch
-----------------------------------------------------scsi_dispatch_cmd 5.5% 0.44% scsi_device_unbusy 6.1% 0.66% scsi_request_fn 6.6% 0.35% scsi_run_queue 5.5% 0.35%
Hi Tim and Co,
Many Thanks for posting these very interesting numbers with unlocked_qcmds=1 + mpt-fusion SCSI LLD on a 64-core system.. Wow.. 8-)
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed SHT->queuecommand() for whatever strange & legacy reasons.
While there are still some outstanding TCM items that need to be resolved in the next days, I am very interested to help make the wholesale host_lock + ->queuecomamnd() conversion happen. I will get a lio-core-2.6.git branch setup for this purpose on .36-rc4 soon and start working on the main SCSI Mid-layer conversion pieces sometime next week. I am very eager to accept patches on a per LLD basis for this work, and will be starting with the open-fcoe initiator, TCM_Loop, mpt2sas, and open-iscsi.
I think the wholesole conversion is going to be pretty straight-forward, and at least with the main SCSI LLDs (that we really care about ;) there appear to be no immediate issues with a full conversion.
Best,
--nab
Quoted 60 lines
Tim Chen
Signed-off-by Tim Chen <[email protected]>drivers/message/fusion/mptsas.c +2
-0@@ -4984,6 +4984,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) sh->max_lun = max_lun; sh->transportt = mptsas_transport_template; + sh->unlocked_qcmds =1 ; +/* Required entry. */ sh->unique_id = ioc->id;drivers/scsi/scsi.c +6
-1@@ -749,11 +749,16 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)if (unlikely (host->shost_state ==SHOST_DEL )) { cmd->result = (DID_NO_CONNECT <<16 );scsi_done (cmd); +spin_unlock_irqrestore (host->host_lock, flags); }else {trace_scsi_dispatch_cmd_start (cmd); +if (host->unlocked_qcmds) +spin_unlock_irqrestore (host->host_lock, flags); rtn = host->hostt->queuecommand (cmd, scsi_done); +if (!host->unlocked_qcmds) +spin_unlock_irqrestore (host->host_lock, flags); } -spin_unlock_irqrestore (host->host_lock, flags); +if (rtn) {trace_scsi_dispatch_cmd_error (cmd, rtn); if (rtn != SCSI_MLQUEUE_DEVICE_BUSY &&include/scsi/scsi_host.h +3
-1@@ -636,6 +636,9 @@ struct Scsi_Host {/* Asynchronous scan in progress */ unsigned async_scan:1; +/* call queuecommand without Scsi_Host lock held */ + unsigned unlocked_qcmds:1; +/* * Optional work queue to be utilized by the transport */ --To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Nicholas A. Bellinger
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
That certainly sounds like the right way to go.
Quoted 9 lines
While there are still some outstanding TCM items that need to be resolved in the next days, I am very interested to help make the wholesale
host_lock+ ->queuecomamnd() conversion happen. I will get a lio-core-2.6.git branch setup for this purpose on .36-rc4 soon and start working on the main SCSI Mid-layer conversion pieces sometime next week. I am very eager to accept patches on a per LLD basis for this work, and will be starting with the open-fcoe initiator,TCM_Loop, mpt2sas, and open-iscsi.
Quoted 4 lines
I think the wholesole conversion is going to be pretty straight-forward, and at least with the main SCSI LLDs (that we really care about ;) there appear to be no immediate issues with a full conversion.
Looking forward to it. Thanks.
Tim
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
-Andi
Quoted 8 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
Quoted 6 lines
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
Yes, that's basically what Christoph did when he moved the lock out of the eh path.
James
Quoted 8 lines · James Bottomley
Quoted 5 lines
into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
Yes, that's basically what Christoph did when he moved the lock out of the eh path.
And it is what we should do here as well. I'm just wondering if we rely on the fact that we hold the lock over the check for the device beeing deleted and the queuecommand call.
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · James Bottomley
Quoted 4 lines
into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Then next step the drivers who know they don't want it can remove it.
Yes, that's basically what Christoph did when he moved the lock out of the eh path.
And it is what we should do here as well. I'm just wondering if we rely on the fact that we hold the lock over the check for the device beeing deleted and the queuecommand call.
Ugh, I completely forgot the about the (host->shost_state == SHOST_DEL) check in scsi_dispatch_cmd() in patch #1, and just fixed this in lio-core-2.6.git/drop-host_lock here:
Here is what the updated scsi_dispatch_cmd() now looks like:
<SNIP>
spin_lock_irqsave(host->host_lock, flags);
/*
* AK: unlikely race here: for some reason the timer could
* expire before the serial number is set up below.
*
* TODO: kill serial or move to blk layer
*/
scsi_cmd_get_serial(host, cmd);
if (unlikely(host->shost_state == SHOST_DEL)) {
spin_unlock_irqrestore(host->host_lock, flags);
cmd->result = (DID_NO_CONNECT << 16);
scsi_done(cmd);
} else {
spin_unlock_irqrestore(host->host_lock, flags);
trace_scsi_dispatch_cmd_start(cmd);
rtn = host->hostt->queuecommand(cmd, scsi_done);
}
<SNIP>Thanks!
--nab
Quoted 33 lines · Nicholas A. Bellinger
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · James Bottomley
Quoted 4 lines
into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Then next step the drivers who know they don't want it can remove it.
Yes, that's basically what Christoph did when he moved the lock out of the eh path.
And it is what we should do here as well. I'm just wondering if we rely on the fact that we hold the lock over the check for the device beeing deleted and the queuecommand call.
Ugh, I completely forgot the about the (
host->shost_state==SHOST_DEL) check inscsi_dispatch_cmd()in patch #1, and just fixed this in lio-core-2.6.git/drop-host_lock here:Here is what the updated
scsi_dispatch_cmd()now looks like:<SNIP> spin_lock_irqsave(host->host_lock, flags); /* * AK: unlikely race here: for some reason the timer could * expire before the serial number is set up below. * * TODO: kill serial or move to blk layer */
Quoted 8 lines
scsi_cmd_get_serial(host, cmd);
if (unlikely(host->shost_state == SHOST_DEL)) {
spin_unlock_irqrestore(host->host_lock, flags);
cmd->result = (DID_NO_CONNECT << 16);
scsi_done(cmd);
} else {
spin_unlock_irqrestore(host->host_lock, flags);This unconditional drop will require LLD still using host lock for their queuecommand to re-acquire the lock and that would hurt their perf as Joe mentioned in his response. Also this change requires all such LLD to grab and drop lock again and that change should go along with this change.
BTW above change is very similar to patch under discussion, just off by tiny additional check :-)
Vasu
Quoted 15 lines
trace_scsi_dispatch_cmd_start(cmd); rtn = host->hostt->queuecommand(cmd, scsi_done); } <SNIP>Thanks!
--nab
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
Quoted 6 lines
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
Well, the main bit is finding those drives that actually call some form of struct Scsi_Host->host_lock unlock() -> do_work() -> lock() from within their own ->queuecomamnd() caller, and avoid running into the big ugly deadlock that would happen here..
I know that Open-iSCSi and my own iSCSI Initiator do this "optimization", but I am not sure which other LLDs also do this as well..
Best,
--nab
Quoted 21 lines · Nicholas A. Bellinger
Quoted 8 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.Quoted 6 lines
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
Well, the main bit is finding those drives that actually call some form of struct
Scsi_Host->host_lockunlock()->do_work()->lock()from within their own ->queuecomamnd() caller, and avoid running into the big ugly deadlock that would happen here..
Quoted 6 lines
I know that Open-iSCSi and my own iSCSI Initiator do this "optimization", but I am not sure which other LLDs also do this as well..
Best,
Ok, spotted another one of these in drivers/scsi/lpfc/lpfc_scsi.c:lpfc_queuecommand():
<SNIP>
if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
spin_unlock(shost->host_lock);
lpfc_sli_handle_fast_ring_event(phba,
&phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ);
spin_lock(shost->host_lock);
if (phba->cfg_poll & DISABLE_FCP_RING_INT)
lpfc_poll_rearm_timer(phba);
}
return 0;Best,
--nab
Quoted 45 lines · Nicholas A. Bellinger
Quoted 21 lines · Nicholas A. Bellinger
Quoted 8 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.Quoted 6 lines
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
Well, the main bit is finding those drives that actually call some form of struct
Scsi_Host->host_lockunlock()->do_work()->lock()from within their own ->queuecomamnd() caller, and avoid running into the big ugly deadlock that would happen here..Quoted 6 lines
I know that Open-iSCSi and my own iSCSI Initiator do this "optimization", but I am not sure which other LLDs also do this as well..
Best,
Ok, spotted another one of these in drivers/scsi/lpfc/lpfc_scsi.c:lpfc_queuecommand():
<SNIP> if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { spin_unlock(shost->host_lock); lpfc_sli_handle_fast_ring_event(phba, &phba->sli.ring[LPFC_FCP_RING], HA_R0RE_REQ); spin_lock(shost->host_lock); if (phba->cfg_poll & DISABLE_FCP_RING_INT) lpfc_poll_rearm_timer(phba); } return 0;
Quoted 1 line
Best,
And ditto ->queuecommand() with qla2xxx and qla4xxx LLDs as well:
<SNIP>
spin_unlock_irq(ha->host->host_lock);
srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done);
if (!srb)
goto qc_host_busy_lock;
rval = qla4xxx_send_command_to_isp(ha, srb);
if (rval != QLA_SUCCESS)
goto qc_host_busy_free_sp;
spin_lock_irq(ha->host->host_lock);
return 0;So yeah, it looks like the high performance LLDs have adopted this trick over the years.. :-)
Best,
--nab
Quoted 8 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
Quoted 8 lines
The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Then next step the drivers who know they don't want it can remove it.
-Andi
I see problems with this, but maybe I'm missing something.
It seems to me we can't completely move the host lock down into the drivers since its a shared lock between SCSI and the drivers now.
If we just have SCSI drop the lock and have the LLD reacquire it, that may open up a hole that some LLDs might not tolerate. It also hurts performance for the LLDs that want to keep the lock for the duration of queuecommand() by adding an extra unlock/lock.
Obviously, some LLDs may depend on that shared lock being held, without a drop just before the call.
So, I think the flag approach is OK, or wait until the wholesale approach can be done.
Regards,
Joe
Quoted 14 lines · Joe Eykholt
Quoted 13 lines · Andi Kleen
Quoted 7 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.The standard way to do that would be to first move the lock down into the drivers (similar to how it has been done with the BKL). This would be a fairly mechanic mindless patch. Lots of typing, but not really a lot of real code review needed.
Quoted 8 lines
Quoted 3 lines
Then next step the drivers who know they don't want it can remove it.
-Andi
I see problems with this, but maybe I'm missing something.
It seems to me we can't completely move the host lock down into the drivers since its a shared lock between SCSI and the drivers now.
Not really ... look at the code path (in scsi.c:scsi_dispatch_cmd()). We take the lock, then get the serial number (that would likley have to be replaced with an atomic), check the state, call trace, call queuecommand and drop the lock. That should be replaceable with a no lock sequence.
For some of our lower latency drivers, we're also going to have to start looking at the queue lock->host lock shuffle we do for I/O accounting.
James
Quoted 3 lines
Not really ... look at the code path (in scsi.c:scsi_dispatch_cmd()). We take the lock, then get the serial number (that would likley have to be replaced with an atomic), check the state, call trace, call
An atomic unfortunately usually doesn't scale much better than a spinlock. I suspect serials would need to be made optional, e.g. computing them lazily if really needed.
-andi
Quoted 8 lines · Andi Kleen
Quoted 4 lines
Not really ... look at the code path (in scsi.c:scsi_dispatch_cmd()). We take the lock, then get the serial number (that would likley have to be replaced with an atomic), check the state, call trace, call
An atomic unfortunately usually doesn't scale much better than a spinlock. I suspect serials would need to be made optional, e.g. computing them lazily if really needed.
We should be careful that the command processing order for commands issued by different threads is not altered by removing the host lock, at least for those SCSI commands where in-order processing matters. There might be better solutions than a serial number though.
Bart.
Quoted 6 lines · Bart Van Assche
Quoted 5 lines · Andi Kleen
Quoted 4 lines
Not really ... look at the code path (in scsi.c:scsi_dispatch_cmd()). We take the lock, then get the serial number (that would likley have to be replaced with an atomic), check the state, call trace, call
Quoted 8 lines
Quoted 3 lines
An atomic unfortunately usually doesn't scale much better than a spinlock. I suspect serials would need to be made optional, e.g. computing them lazily if really needed.
We should be careful that the command processing order for commands issued by different threads is not altered by removing the host lock, at least for those SCSI commands where in-order processing matters. There might be better solutions than a serial number though.
We don't actually make any ordering guarantees at the top of the stack. The block layer originally did need internal ordering guarantees for barriers, but they were automatically preserved by the fact that the exit from the ioscheduler is single threaded.
However, the barrier redo means that we no longer even need the single threaded guarantee ... and I suspect Jens is already thinking about multi threading the ioscheduler exit, which is also another good reason for reducing the locking footprint.
James
Quoted 9 lines · Joe Eykholt
It seems to me we can't completely move the host lock down into the drivers since its a shared lock between SCSI and the drivers now.
If we just have SCSI drop the lock and have the LLD reacquire it, that may open up a hole that some LLDs might not tolerate. It also hurts performance for the LLDs that want to keep the lock for the duration of
queuecommand()by adding an extra unlock/lock.
It may be even better if we can completely drop the lock in scsi_dispatch_cmd. The other reason host_lock was taken there was to serialize the increment and assignment of a scsi command serial number. So maybe we can make the serial number counter an atomic.
We can just let the driver decide if they need a lock to serialize their queue command.
Tim
Quoted 28 lines · Nicholas A. Bellinger
Quoted 17 lines · Tim Chen
During testing of FFSB benchmark (configured with
128 threaded write to 128 files on 16 SSD),scsi_hostlock was
heavily contended, accounting for 23.7% of cpu cycles. There
are 64 cores in our test system and the JBOD
is connected with a mptsas HBA. Taking a similar approach
as the patch by Vasu (http://permalink.gmane.org/gmane.linux.scsi.open-fcoe.devel/10110)
for Fiber Channel adapter, the following patch on 2.6.35 kernel
avoids taking the scsi host lock when queueing mptsas scsi command. We see a big drop in the cpu cycles contending for the lock (from 23.7% to 1.8%). The number of IO per sec increase by 10.6% from 62.9K per sec to 69.6K per sec.If there is no good reason to prevent
mptsas_qcmdfrom being executed in parallel, we should remove this lock from the queue command code path. Other adapters probably can benefit in a similar manner.Quoted 9 lines
%cpu cycles contending host lock
2.6.35 2.6.35+patch
-----------------------------------------------------scsi_dispatch_cmd 5.5% 0.44% scsi_device_unbusy 6.1% 0.66% scsi_request_fn 6.6% 0.35% scsi_run_queue 5.5% 0.35%
Quoted 5 lines
Hi Tim and Co,
Many Thanks for posting these very interesting numbers with unlocked_qcmds=1 + mpt-fusion SCSI LLD on a 64-core system.. Wow.. 8-)
I echo same, thanks Tim for these detailed numbers.
Quoted 8 lines
I asked James about getting Vasu's unlocked_qcmds=1 patch merged, but he convinced me that doing conditional locking while is very simple, is not the proper way for getting this resolved in mainline code. I think in the end this will require a longer sit down to do a wholesale conversion of all existing SCSI LLD drivers, and identifing the broken ones that still need a struct Scsi_Host->host_lock'ed
SHT->queuecommand()for whatever strange & legacy reasons.
I think doing few LLDs first and resolving any new issues caused by no host_lock in those LLD would have helped with wholesale conv, beside if a simple change helps perf now then should be good to have till wholesale change done. However I'm also fine jumping to wholesale approach directly.
Quoted 9 lines
While there are still some outstanding TCM items that need to be resolved in the next days, I am very interested to help make the wholesale
host_lock+ ->queuecomamnd() conversion happen. I will get a lio-core-2.6.git branch setup for this purpose on .36-rc4 soon and start working on the main SCSI Mid-layer conversion pieces sometime next week. I am very eager to accept patches on a per LLD basis for this work, and will be starting with the open-fcoe initiator,TCM_Loop, mpt2sas, and open-iscsi.
Quoted 4 lines
I think the wholesole conversion is going to be pretty straight-forward, and at least with the main SCSI LLDs (that we really care about ;) there appear to be no immediate issues with a full conversion.
Sounds good, I wish I could help with that now but won't be able to till Dec since heading for sabbatical this week.
Thanks
Vasu