public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: David Somayajulu <david.somayajulu@qlogic.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
	James.Smart@Emulex.Com,
	James Bottomley <James.Bottomley@SteelEye.com>,
	linux-scsi@vger.kernel.org, Doug Maxey <dwm@enoyolf.org>,
	David Wagner <david.wagner@qlogic.com>,
	Ravi Anand <ravi.anand@qlogic.com>,
	Duane Grigsby <duane.grigsby@qlogic.com>
Subject: Re: [RFC] [PATCH] qla4xxx driver resubmission
Date: Thu, 21 Sep 2006 21:00:41 +0200	[thread overview]
Message-ID: <20060921190041.GI16556@kernel.dk> (raw)
In-Reply-To: <0BB3E5E7462EEA4295BC02D49691DC074144D8@AVEXCH1.qlogic.org>

On Thu, Sep 21 2006, David Somayajulu wrote:
> 
> 
> > -----Original Message-----
> > From: Jens Axboe [mailto:axboe@kernel.dk]
> > Sent: Thursday, September 21, 2006 11:48 AM
> > To: Mike Christie
> > Cc: James.Smart@Emulex.Com; David Somayajulu; James Bottomley;
> linux-scsi@vger.kernel.org; Doug
> > Maxey; David Wagner; Ravi Anand; Duane Grigsby
> > Subject: Re: [RFC] [PATCH] qla4xxx driver resubmission
> > 
> > On Thu, Sep 21 2006, Jens Axboe wrote:
> > > On Thu, Sep 21 2006, Mike Christie wrote:
> > > > Jens Axboe wrote:
> > > > > On Thu, Sep 21 2006, Mike Christie wrote:
> > > > >> James Smart wrote:
> > > > >>> Why does your LLD need to reach up into the block layer to
> find an i/o ?
> > > > >>>
> > > > >>> Even if you are using tags as an index into something... I
> would think that
> > > > >>> having to go up to the blk layer to retrieve a something that
> should have
> > > > >>> already been known lower in the driver leaves room for race
> conditions.
> > > > >>>
> > > > >> This is how the blk and scsi tag api work for queue based
> tagging. We
> > > > >> have the scsi_find_tag() function which takes a scsi device and
> than
> > > > >> calls blk_queue_find_tag to get the request. It then does all
> the magic
> > > > >> sdev to request_queue and request to scsi command work and pass
> the LLD
> > > > >> the scsi command for the tag. So we can either add a driver
> array and do
> > > > >> some tag to scsi command or driver stucture mapping or we can
> use the
> > > > >> array already created in the scsi host block queue tag. And as
> you see
> > > > >> Dave's patch did the latter in the spirit of not duplicating
> what
> > > > >> scsi-ml or the block layer already do.
> > > > >>
> > > > >> I think there are some basic races though. For example,
> scsi_request_fn
> > > > >> calls blk_queue_start_tag with only the queue lock held and so
> if the
> > > > >> request_fn was called for two devices on the same host at the
> same time
> > > > >> they both could call find_first_zero_bit on the shared
> bqt->tag_map and
> > > > >> end up getting the same tag.
> > > > >
> > > > > Hrmpf good point, I suspect that would be easy enough to fix
> with just
> > > > > using a
> > > > >
> > > > >         do {
> > > > >                 tag = ffz_bit(..);
> > > > >         } while (test_and_set_bit(tag, map);
> > > > >
> > > > > construct. Agree?
> > > > >
> > > >
> > > > I think so. I think this is similar to what Dave was going to do
> too.
> > >
> > > Already checked in such a fix:
> > >
> > >
> http://git.kernel.dk/?p=linux-2.6-block.git;a=commit;h=7ddbe6863ac4b7a55
> 88aa4a70f262c098f3c469a
> 
> Thanks. This a lot elegant than the one I came up with using a lock. 
> Jens, any comments on this patch
> [RFC] [PATCH] helper function for retrieving scsi_cmd given host based
> block layer tag
> http://marc.theaimsgroup.com/?l=linux-scsi&m=115871027627964&w=2

Patch looks very nice to me, I'll apply it and let James scream if he
dislikes it for some reason (I don't see why, though).

-- 
Jens Axboe


  reply	other threads:[~2006-09-21 18:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-20  0:08 [RFC] [PATCH] qla4xxx driver resubmission David C Somayajulu
2006-09-21 13:46 ` James Smart
2006-09-21 17:35   ` David Somayajulu
2006-09-21 18:11     ` James Smart
2006-09-21 18:35       ` Mike Christie
2006-09-21 18:25   ` Mike Christie
2006-09-21 18:35     ` Jens Axboe
2006-09-21 18:37       ` Mike Christie
2006-09-21 18:45         ` Jens Axboe
2006-09-21 18:47           ` Jens Axboe
2006-09-21 18:55             ` David Somayajulu
2006-09-21 19:00               ` Jens Axboe [this message]
2006-09-25 16:56                 ` David Somayajulu
2006-09-30  0:42                   ` David Somayajulu
2006-10-04 15:49                     ` James Bottomley
2006-10-04 16:30                       ` David Somayajulu
2006-10-04 16:39                         ` James Bottomley
2006-10-04 16:44                         ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2006-07-27 18:30 David Somayajulu
2006-07-27 19:11 ` David C Somayajulu
2006-07-27 22:09   ` Doug Maxey

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=20060921190041.GI16556@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=James.Bottomley@SteelEye.com \
    --cc=James.Smart@Emulex.Com \
    --cc=david.somayajulu@qlogic.com \
    --cc=david.wagner@qlogic.com \
    --cc=duane.grigsby@qlogic.com \
    --cc=dwm@enoyolf.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=ravi.anand@qlogic.com \
    /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