From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Andi Kleen <andi@firstfloor.org>,
Stefan Richter <stefanr@s5r6.in-berlin.de>,
Boaz Harrosh <bharrosh@panasas.com>,
James.Bottomley@suse.de, linux-scsi@vger.kernel.org,
Linux IDE mailing list <linux-ide@vger.kernel.org>
Subject: Re: Full hostlock pushdown available
Date: Mon, 01 Nov 2010 14:06:19 -0700 [thread overview]
Message-ID: <1288645579.7708.10.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <4CCF0DFE.4050106@garzik.org>
On Mon, 2010-11-01 at 14:59 -0400, Jeff Garzik wrote:
> On 11/01/2010 01:57 PM, Andi Kleen wrote:
> > @@ -3186,11 +3186,14 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done
> > struct ata_device *dev;
> > struct scsi_device *scsidev = cmd->device;
> > struct Scsi_Host *shost = scsidev->host;
> > + unsigned long irqflags;
> > int rc = 0;
> >
> > ap = ata_shost_to_port(shost);
> >
> > - spin_unlock(shost->host_lock);
> > + spin_lock_irqsave(shost->host_lock, irqflags);
> > + scsi_cmd_get_serial(shost, cmd);
> > +
> > spin_lock(ap->lock);
> >
> > ata_scsi_dump_cdb(ap, cmd);
> > @@ -3205,6 +3208,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(
> >
> > spin_unlock(ap->lock);
> > spin_lock(shost->host_lock);
> > + spin_unlock_irqrestore(shost->host_lock, irqflags);
> > return rc;
> > }
> >
>
> It's a bit disappointing that libata's lock profile in this patch is
> quite different than that of current upstream: with your patch, libata
> holds the scsi host lock for a considerably longer period of time, while
> also holding the ATA port/host spinlock.
>
> IOW, it's doing the exact opposite of what the previous code did
> (release the scsi host lock, before acquiring the ATA port/host
> spinlock), not at all an equivalent transformation.
>
> The following sequence would seem to better preserve the existing lock
> profile, correct?
>
> local_irq_save(flags)
>
> spin_lock(shost->host_lock)
> scsi_cmd_get_serial()
> spin_unlock(shost->host_lock)
>
> spin_lock(ap->lock)
> ...
> spin_unlock(ap->lock)
>
> local_irq_restore(flags)
>
Hmmmmm yes.. Along with Andi's generated patches I think we should
strongly consider including the atomic_t Scsi_Host->cmd_serial_number
patch here as well for scsi_cmd_get_serial() (which needs EXPORT_SYMBOL)
http://git.kernel.org/?p=linux/kernel/git/nab/lio-4.0.git;a=commitdiff;h=c047a53c52ee6c90daf048b045750e18173fd011#patch68
http://git.kernel.org/?p=linux/kernel/git/nab/lio-4.0.git;a=commitdiff;h=c047a53c52ee6c90daf048b045750e18173fd011#patch37
http://git.kernel.org/?p=linux/kernel/git/nab/lio-4.0.git;a=commitdiff;h=c047a53c52ee6c90daf048b045750e18173fd011#patch82
This ends up being a very simple change, and would allow libata to
immediately go host_lock less for scsi_cmd_dispatch() operation.
FYI, the current scoreboard for the global push down is available in
lio-core-4.0.git/host_lock-less-for-37-v9 at the top of the above
commit.. I think Andi is missing a few LLDs outside of /drivers/scsi/
Best,
--nab
next prev parent reply other threads:[~2010-11-01 21:11 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 15:05 Full hostlock pushdown available Andi Kleen
2010-10-28 19:28 ` James Bottomley
2010-10-28 19:32 ` Nicholas A. Bellinger
2010-11-01 14:06 ` Andi Kleen
2010-11-01 14:29 ` James Bottomley
2010-10-28 20:10 ` Andi Kleen
2010-10-28 20:22 ` James Bottomley
2010-10-28 21:50 ` Andi Kleen
2010-10-28 22:37 ` Nicholas A. Bellinger
2010-10-31 12:22 ` Boaz Harrosh
2010-10-31 18:48 ` Stefan Richter
2010-11-01 2:34 ` Jeff Garzik
2010-11-01 13:53 ` Andi Kleen
2010-11-01 15:56 ` Jeff Garzik
2010-11-01 17:57 ` Andi Kleen
2010-11-01 18:42 ` Jeff Garzik
2010-11-02 15:05 ` Andi Kleen
2010-11-01 18:59 ` Jeff Garzik
2010-11-01 21:06 ` Nicholas A. Bellinger [this message]
2010-11-02 9:21 ` Andi Kleen
2010-11-02 15:59 ` Jeff Garzik
2010-11-02 17:53 ` Andi Kleen
2010-11-02 18:13 ` Jeff Garzik
2010-11-02 18:38 ` Nicholas A. Bellinger
2010-11-02 18:50 ` Jeff Garzik
2010-11-01 13:54 ` Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1288645579.7708.10.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@suse.de \
--cc=andi@firstfloor.org \
--cc=bharrosh@panasas.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stefanr@s5r6.in-berlin.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox