From: Tejun Heo <htejun@gmail.com>
To: James.Bottomley@steeleye.com, axboe@suse.de,
Christoph Hellwig <hch@infradead.org>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH scsi-misc-2.6 03/04] scsi: reimplement scsi_request_fn()
Date: Tue, 12 Apr 2005 19:37:50 +0900 [thread overview]
Message-ID: <20050412103750.GA23571@htj.dyndns.org> (raw)
In-Reply-To: <20050412103128.5C5F0B72@htj.dyndns.org>
Oops, I forgot to mention that reqfn is reformatted mostly as
suggested by Chritoph Hellwig. Sorry.
On Tue, Apr 12, 2005 at 07:33:03PM +0900, Tejun Heo wrote:
> 03_scsi_reqfn_reimplementation.patch
>
> This patch rewrites scsi_request_fn(). scsi_dispatch_cmd() is
> merged into scsi_request_fn(). Goals are
>
> * Remove unnecessary operations (host_lock unlocking/locking,
> recursing into scsi_run_queue(), ...)
> * Consolidate defer/kill paths.
> * Be concise.
>
> The following bugs are fixed.
>
> * All killed requests now get fully prep'ed and pass through
> __scsi_done(). This is the only kill path.
> - scsi_cmnd leak in offline-kill path removed
> - unfinished request bug in
> scsi_dispatch_cmd():SDEV_DEL-kill path removed.
> - commands are never terminated directly from blk
> layer unless they are invalid, so no need to supply
> req->end_io callback for special requests.
> * Timer is added while holding host_lock, after all conditions
> are checked and serial number is assigned. This guarantees
> that until host_lock is released, the scsi_cmnd pointed to
> by cmd isn't released. That didn't hold in the original
> code and, theoretically, the original code could access
> already released cmd.
> * For the same reason, if shost->hostt->queuecommand() fails,
> we try to delete the timer before releasing host_lock.
>
> Other changes/notes
>
> * host_lock is acquired and released only once.
> enter (qlocked) -> enter loop -> dev-prep -> switch to hlock -\
> ^---- switch to qlock <- issue <- host-prep <-/
> * unnecessary if () on get_device() removed.
> * loop on elv_next_request() instead of blk_queue_plugged().
> We now explicitly break out of loop when we plug and check if
> the queue has been plugged underneath us at the end of loop.
> * All device/host state checks are done in this function and
> done only once while holding qlock/host_lock respectively.
> * Requests which get deferred during dev-prep are never
> removed from request queue, so deferring is achieved by
> simply breaking out of the loop and returning.
> * Failure of blk_queue_start_tag() on tagged queue is a BUG
> now. This condition should have been catched by
> scsi_dev_queue_ready().
> * req->special == NULL test removed. This just can't happen,
> and even if it ever happens, scsi_request_fn() will
> deterministically oops.
> * Requests which gets deferred during host-prep are requeued
> using blk_requeue_request(). This is the only requeue path.
>
> Note that scsi_kill_requests() still terminates requests using
> blk layer. The path is circular-ref workaround and soon to be
> replaced, so ignore it for now.
--
tejun
next prev parent reply other threads:[~2005-04-12 10:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-12 10:32 [PATCH scsi-misc-2.6 00/04] scsi: scsi_request_fn() reimplementation Tejun Heo
2005-04-12 10:32 ` [PATCH scsi-misc-2.6 01/04] scsi: consolidate error handling out of scsi_init_io() into scsi_prep_fn() Tejun Heo
2005-04-12 10:32 ` [PATCH scsi-misc-2.6 02/04] scsi: move request preps in other places into prep_fn() Tejun Heo
2005-04-12 10:33 ` [PATCH scsi-misc-2.6 03/04] scsi: reimplement scsi_request_fn() Tejun Heo
2005-04-12 10:37 ` Tejun Heo [this message]
2005-04-12 10:33 ` [PATCH scsi-misc-2.6 04/04] scsi: remove unnecessary scsi_wait_req_end_io() Tejun Heo
2005-04-12 11:01 ` [PATCH scsi-misc-2.6 00/04] scsi: scsi_request_fn() reimplementation Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2005-05-14 13:57 Tejun Heo
2005-05-14 13:57 ` [PATCH scsi-misc-2.6 03/04] scsi: reimplement scsi_request_fn() Tejun Heo
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=20050412103750.GA23571@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=James.Bottomley@steeleye.com \
--cc=axboe@suse.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox