From: Jens Axboe <axboe@suse.de>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>,
linux-ide@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] libata error handling fixes (ATAPI)
Date: Wed, 16 Nov 2005 16:31:19 +0100 [thread overview]
Message-ID: <20051116153119.GN7787@suse.de> (raw)
In-Reply-To: <58cb370e0511160704w4803a085h7bd6ab352d8c94e6@mail.gmail.com>
On Wed, Nov 16 2005, Bartlomiej Zolnierkiewicz wrote:
> On 11/16/05, Jens Axboe <axboe@suse.de> wrote:
>
> > I updated that patch, and converted IDE and SCSI to use it. See the
> > results here:
> >
> > http://brick.kernel.dk/git/?p=linux-2.6-block.git;a=shortlog;h=blk-softirq
>
> I like it but:
>
> * "we know it's either an FS or PC request" assumption in
> ide_softirq_done() is really wrong
It used to be correct :-)
No, the problem is that I changed the partial stuff to allow the
deletion/putting of the request to work for every type of request. But
it definitely needs some more looking into.
> * same with "uptodate = rq->errors"
Yeah. In general, ->errors needs to be streamlined. It's a huge mess
right now and it's making generic code really hard to do because every
driver does their own weird thing with it.
I'd like for IDE to really do stuff the error in ->errors, and push the
retry or whatever counting into a ->retries instead. Then we can honor
the simple rule of, rq->errors:
< 0, it contains an -Exxxx value
== 0, no errors, uptodate
> 0, not uptodate, no specific error info. Usually 1.
> * blk_complete_request() is called with ide_lock hold but
> ide_softirq_done() also takes ide_lock - is this correct?
blk_complete_request() need not be called with the lock held, in fact it
would be best if it wasn't (no point in holding the lock). But right now
it is in ide, because of the below. ide_softirq_done() always needs to
grab the lock. There are no recursion problems there, ide_softirq_done()
is called out-of-order from the actual completion call.
> "There's still room for improvement, as __ide_end_request() really
> could drop the lock after getting HWGROUP->rq (why does it need to
> hold it in the first place? If ->rq access isn't serialized, we are
> screwed anyways)."
>
> ide_preempt? and yes we are screwed...
Irk it's nasty, since it basically means we have to hold ide_lock over
the entire functions looking at hwgroup->rq.
It's ok for __ide_end_request() to be entered with the ide_lock held,
the costly affair is usually completing the request. Which now happens
outside of the lock.
We could split the completion path in two - if we know this call will
end the request completely, we can drop the lock and call into the
blk_complete_request() stuff for free. We know we need to clear
hwgroup->rq anyways, so we can do it up front and complete the request
'privately'. If we are not fully completing the request, keep the lock
and do the partial completion. The bonus here is that the first case
will be the often taken path by far (always with DMA and no errors), the
other cases are not interesting from a performance perspective.
--
Jens Axboe
next prev parent reply other threads:[~2005-11-16 15:30 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-14 19:57 [PATCH] libata error handling fixes (ATAPI) Jeff Garzik
2005-11-15 7:41 ` Tejun Heo
2005-11-15 9:28 ` Jeff Garzik
2005-11-15 10:03 ` Tejun Heo
2005-11-15 11:02 ` Jeff Garzik
2005-11-15 12:00 ` Jens Axboe
2005-11-15 18:25 ` Mike Christie
2005-11-15 18:41 ` Jens Axboe
2005-11-16 12:40 ` Jens Axboe
2005-11-16 12:56 ` Jeff Garzik
2005-11-16 13:13 ` Jens Axboe
2005-11-16 13:23 ` Jeff Garzik
2005-11-16 13:31 ` Jeff Garzik
2005-11-16 13:47 ` Jens Axboe
2005-11-16 15:04 ` Bartlomiej Zolnierkiewicz
2005-11-16 15:31 ` Jens Axboe [this message]
2005-11-16 16:06 ` Bartlomiej Zolnierkiewicz
2005-11-16 17:10 ` Jens Axboe
2005-11-16 19:11 ` Bartlomiej Zolnierkiewicz
2005-11-16 19:22 ` Jens Axboe
2005-11-16 19:45 ` Jens Axboe
2005-11-16 19:46 ` Bartlomiej Zolnierkiewicz
2005-11-16 19:55 ` Bartlomiej Zolnierkiewicz
2005-11-16 20:02 ` Jens Axboe
2005-11-16 20:23 ` Bartlomiej Zolnierkiewicz
2005-11-16 20:40 ` Jens Axboe
2005-11-19 10:55 ` Christoph Hellwig
2005-11-19 13:27 ` Jens Axboe
2005-11-15 13:43 ` Tejun Heo
2005-11-15 14:11 ` Jeff Garzik
2005-11-16 3:04 ` Tejun Heo
2005-11-16 3:18 ` Jeff Garzik
2005-11-16 3:48 ` Mark Lord
2005-11-16 3:58 ` Jeff Garzik
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=20051116153119.GN7787@suse.de \
--to=axboe@suse.de \
--cc=bzolnier@gmail.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.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;
as well as URLs for NNTP newsgroup(s).