From: Tejun Heo <tj@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Jens Axboe <jens.axboe@oracle.com>,
Mike Anderson <andmike@linux.vnet.ibm.com>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
SCSI development list <linux-scsi@vger.kernel.org>,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Problems with the block-layer timeouts
Date: Tue, 04 Nov 2008 01:39:47 +0900 [thread overview]
Message-ID: <490F2953.30709@kernel.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0811031051210.2454-100000@iolanthe.rowland.org>
Hello, Alan Stern! :-)
Alan Stern wrote:
> Even a "peek and fetch" interface might not be best, at least as far as
> timer issues are concerned. Ideally, the timer shouldn't be started
> until the SCSI midlayer knows that the request has successfully been
> sent to the lower-level driver.
>
> Therefore the best approach would be to EXPORT blk_add_timer(). It
> should be called at the end of scsi_dispatch_cmd(), when the return
> value from the queuecommand method is known to be 0.
>
> With something like this, Mike's fix to end_that_request_last()
> wouldn't be needed, since blkdev_dequeue_request() wouldn't
> automatically start the timer. It seems silly to start the timer when
> you know you're just going to stop it immediately afterwards.
Block layer currently doesn't know when a request is actually being
issued. For timeout, blk_add_timer() can be exported but I think that
only aggravate the already highly fragmented block layer interface
(different users use it differently to the point of scary chaos). For
minor example, block tracing considers elv_next_request() as the command
issue point which isn't quite true for SCSI and many other drivers. For
that too, we can export the tracing interface but I don't think that's
the right direction. More stuff are scheduled to be moved to block
layer and exporting more and more implementation details to block layer
users will have hard time scaling.
I'm trying to convert all drivers to use the same command issue model -
elv_next_request() -> blkdev_dequeue_request() on actual issue ->
blk_end_request(). I have first draft of the conversion patchset but
it's gonna take me a few more days to review and test what I can as
several drivers (mostly legacy ones) are a bit tricky.
For the time being, SCSI layer is the only block layer timeout user and
completion w/o dequeuing is only for error cases in SCSI, so the
inefficiency there shouldn't matter too much.
Jens, what do you think?
Thanks.
--
tejun
next prev parent reply other threads:[~2008-11-03 16:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-01 16:54 Problems with the block-layer timeouts Alan Stern
2008-11-02 20:35 ` Mike Anderson
2008-11-03 8:52 ` Jens Axboe
2008-11-03 14:18 ` James Smart
2008-11-03 17:23 ` Jens Axboe
2008-11-03 15:59 ` Alan Stern
2008-11-03 16:39 ` Tejun Heo [this message]
2008-11-03 17:07 ` Alan Stern
2008-11-03 17:27 ` Jens Axboe
2008-11-04 3:01 ` Tejun Heo
2008-11-06 0:01 ` FUJITA Tomonori
2008-11-06 7:23 ` Jens Axboe
2008-11-07 4:05 ` FUJITA Tomonori
2008-11-07 11:24 ` Jens Axboe
2008-11-11 6:54 ` FUJITA Tomonori
2008-11-11 17:11 ` Alan Stern
2008-11-11 19:19 ` Jens Axboe
2008-11-12 2:08 ` FUJITA Tomonori
2008-11-13 10:34 ` Jens Axboe
2008-11-17 3:48 ` FUJITA Tomonori
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=490F2953.30709@kernel.org \
--to=tj@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=andmike@linux.vnet.ibm.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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