Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756631AbYKCQkR (ORCPT ); Mon, 3 Nov 2008 11:40:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755577AbYKCQkD (ORCPT ); Mon, 3 Nov 2008 11:40:03 -0500 Received: from hera.kernel.org ([140.211.167.34]:60036 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755211AbYKCQkB (ORCPT ); Mon, 3 Nov 2008 11:40:01 -0500 Message-ID: <490F2953.30709@kernel.org> Date: Tue, 04 Nov 2008 01:39:47 +0900 From: Tejun Heo User-Agent: Thunderbird 2.0.0.12 (X11/20071114) MIME-Version: 1.0 To: Alan Stern CC: Jens Axboe , Mike Anderson , James Bottomley , SCSI development list , Kernel development list Subject: Re: Problems with the block-layer timeouts References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (hera.kernel.org [127.0.0.1]); Mon, 03 Nov 2008 16:39:51 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2241 Lines: 49 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/