linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jun'ichi Nomura" <j-nomura@ce.jp.nec.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>,
	jens.axboe@oracle.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, dm-devel@redhat.com,
	michaelc@cs.wisc.edu
Subject: Re: [RFC PATCH 1/3] block: add rq->complete_io hook for request stacking
Date: Tue, 04 Mar 2008 15:02:22 -0500	[thread overview]
Message-ID: <47CDAACE.3090203@ce.jp.nec.com> (raw)
In-Reply-To: <47CD03DE.3010703@suse.de>

Hi Hannes,

Hannes Reinecke wrote:
> Kiyoshi Ueda wrote:
>> I'm thinking about an idea come from Mike and Jens after the session
>> at LSF'08:
>>   o stacking driver clones both bio and request and uses
>>     bio->bi_end_io and rq->end_io
>>   o stacking driver uses blk_complete_request() in rq->end_io
>>     so that stacking driver can work without queue lock
>> With this idea, we don't need to add the new hook to request,
>> and we can use request stacking on drivers using __blk_end_request().
>>
> Huh? I can't really imagine how this should work. If you start using
> bio->bi_end_io() for stacking usage you'll end up with doing weird thing
> with the bios ... Can you elaborate a bit more here?

Cloned bio's bi_end_io() can check the error.

For successful I/O, it calls something equivalent to
end_that_request_first() for the original request,
that may eventually complete the original bio and
notify the submitter.

For error, it can decide not to complete the original bio
and record the error information.

When the clone request is finally completed and rq->end_io() is
called, stacking driver can check the recorded error information
and decide whether it should take any action or just complete
the original request by blk_complete_request().

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America

      reply	other threads:[~2008-03-04 20:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-15 22:27 [RFC PATCH 1/3] block: add rq->complete_io hook for request stacking Kiyoshi Ueda
2008-03-03 16:24 ` Hannes Reinecke
2008-03-03 17:33   ` Grant Grundler
2008-03-03 17:49   ` Jens Axboe
2008-03-03 19:04   ` Kiyoshi Ueda
2008-03-04  8:10     ` Hannes Reinecke
2008-03-04 20:02       ` Jun'ichi Nomura [this message]

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=47CDAACE.3090203@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=jens.axboe@oracle.com \
    --cc=k-ueda@ct.jp.nec.com \
    --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).