public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: device-mapper development <dm-devel@redhat.com>
Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>,
	mchristi@redhat.com, linux-kernel@vger.kernel.org,
	agk@redhat.com
Subject: Re: [dm-devel] Re: [RFC PATCH 1/8] rqbased-dm: allow blk_get_request() to be called from interrupt context
Date: Thu, 21 Dec 2006 11:59:05 -0600	[thread overview]
Message-ID: <458ACB69.8000603@cs.wisc.edu> (raw)
In-Reply-To: <20061221075305.GD17199@kernel.dk>

Jens Axboe wrote:
> On Wed, Dec 20 2006, Kiyoshi Ueda wrote:
>> Hi Jens,
>>
>> On Wed, 20 Dec 2006 19:49:17 +0100, Jens Axboe <jens.axboe@oracle.com> wrote:
>>>>> Big NACK on this - it's not only really ugly, it's also buggy to pass
>>>>> interrupt flags as function arguments. As you also mention in the 0/1
>>>>> mail, this also breaks CFQ.
>>>>>
>>>>> Why do you need in-interrupt request allocation?
>>>>  
>>>> Because I'd like to use blk_get_request() in q->request_fn()
>>>> which can be called from interrupt context like below:
>>>>   scsi_io_completion -> scsi_end_request -> scsi_next_command
>>>>   -> scsi_run_queue -> blk_run_queue -> q->request_fn
>>>>
>>>> Generally, device-mapper (dm) clones an original I/O and dispatches
>>>> the clones to underlying destination devices.
>>>> In the request-based dm patch, the clone creation and the dispatch
>>>> are done in q->request_fn().  To create the clone, blk_get_request()
>>>> is used to get a request from underlying destination device's queue.
>>>> By doing that in q->request_fn(), dm can deal with struct request
>>>> after bios are merged by __make_request().
>>>>
>>>> Do you think creating another function like blk_get_request_nowait()
>>>> is acceptable?
>>>> Or request should not be allocated in q->request_fn() anyway?
>>> You should not be allocating requests from that path, for a number of
>>> reasons.
>> Could I hear the reasons for my further work if possible?
>> Because of breaking current CFQ?  And is there any reason?
> 
> Mainly I just don't like the design, there are better ways to achieve
> what you need. The block layer has certain assumptions on the context
> from which rq allocation happens, and this breaks it. As I also
> mentioned, you cannot pass flags around as arguments. So the patch is
> even broken as-is.
> 


I was thinking that since this was going to be hooked into dm which has
the make_request hook in code, could we just allocate the cloned request
when from dm's make_request callout. The dm queue would call
__make_request, and if it detected that the bio started a new request it
would just allocate a second request which would be used as a clone or
maybe the block layer could allocate the clone request for us. On the
request_fn callout side, DM could then setup the cloned rq based on the
original fields and pass it down to the dm-multipath request_fn. The
dm-mutlipath request_fn then just decides which path to use based on the
path-selector modules and then we send it off.


  reply	other threads:[~2006-12-21 18:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-19 22:11 [RFC PATCH 1/8] rqbased-dm: allow blk_get_request() to be called from interrupt context Kiyoshi Ueda
2006-12-20 13:48 ` Jens Axboe
2006-12-20 17:50   ` Kiyoshi Ueda
2006-12-20 18:49     ` Jens Axboe
2006-12-20 21:55       ` Kiyoshi Ueda
2006-12-21  7:53         ` Jens Axboe
2006-12-21 17:59           ` Mike Christie [this message]
2006-12-21 18:13             ` [dm-devel] " Mike Christie
2006-12-21 18:24               ` Jens Axboe
2006-12-21 18:30                 ` Mike Christie
2006-12-21 18:36                   ` Mike Christie
2006-12-21 18:42                     ` Jens Axboe
2006-12-21 18:57                       ` Mike Christie
2006-12-21 19:19                         ` Jens Axboe
2006-12-21 22:22                           ` Mike Christie
2006-12-21 18:40                   ` Jens Axboe
2006-12-21 18:11           ` Kiyoshi Ueda
2006-12-21 18:21             ` Jens Axboe
2006-12-20 19:11     ` Chen, Kenneth W
2006-12-20 19:17       ` Jens Axboe
2006-12-22 14:01     ` Christoph Hellwig
2006-12-22 17:32       ` Jens Axboe

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=458ACB69.8000603@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=k-ueda@ct.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchristi@redhat.com \
    /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