From: James Bottomley <James.Bottomley@steeleye.com>
To: dougg@torque.net
Cc: Brian King <brking@us.ibm.com>,
dgilbert@interlog.com,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] sg block layer tcqing fix
Date: 06 Jan 2004 09:14:29 -0600 [thread overview]
Message-ID: <1073402071.2047.5.camel@mulgrave> (raw)
In-Reply-To: <3FFA426B.2030406@torque.net>
On Mon, 2004-01-05 at 23:06, Douglas Gilbert wrote:
> Given that no other ULDs call blk_queue_*_tag() routines it seems
> a bit strange that sg, st and osst need to call blk_queue_end_tag()
> prior to calling scsi_release_request(). Perhaps the cleanup can be
> built into scsi_release_request() or a new variant (e.g.
> scsi_release_special_request() ) could be introduced.
I agree. Having the ULD stop tags but not start them is a layering
violation. The attached patch will end the tag in the release request.
It's still appropriate to release the tag earlier, as the mid layer does
to free up tag slots for other requests. Once the tag is ended, the tag
queue flag is cleared, so the check in release request now fails.
James
===== drivers/scsi/scsi.c 1.132 vs edited =====
--- 1.132/drivers/scsi/scsi.c Tue Sep 30 09:24:17 2003
+++ edited/drivers/scsi/scsi.c Tue Jan 6 09:10:25 2004
@@ -142,6 +142,23 @@
void __scsi_release_request(struct scsi_request *sreq)
{
+ struct request *req = sreq->sr_request;
+
+ /* unlikely because the tag was usually ended earlier
+ *
+ * NOTE: the lock should be held while checking the
+ * flag. However, any race here requiring the lock
+ * would be a gross error. */
+ if (unlikely(blk_rq_tagged(req))) {
+ unsigned long flags;
+ struct request_queue *q = req->q;
+
+ spin_lock_irqsave(q->queue_lock, flags);
+ blk_queue_end_tag(q, req);
+ spin_unlock_irqrestore(q->queue_lock, flags);
+ }
+
+
if (likely(sreq->sr_command != NULL)) {
struct scsi_cmnd *cmd = sreq->sr_command;
next prev parent reply other threads:[~2004-01-06 15:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-29 20:29 [PATCH] sg block layer tcqing fix Brian King
2004-01-06 5:06 ` Douglas Gilbert
2004-01-06 11:46 ` Willem Riede
2004-01-06 15:14 ` James Bottomley [this message]
2004-01-06 15:22 ` Jens Axboe
2004-01-06 15:30 ` James Bottomley
2004-01-06 15:37 ` Jens Axboe
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=1073402071.2047.5.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=brking@us.ibm.com \
--cc=dgilbert@interlog.com \
--cc=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
/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 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.