Linux Device Mapper development
 help / color / mirror / Atom feed
From: Junichi Nomura <j-nomura@ce.jp.nec.com>
To: Mike Snitzer <snitzer@redhat.com>,
	Keith Busch <keith.busch@intel.com>,
	Christoph Hellwig <hch@infradead.org>
Cc: "dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: dm-mpath: Work with blk multi-queue drivers
Date: Tue, 30 Sep 2014 23:43:47 +0000	[thread overview]
Message-ID: <542B4033.30001@ce.jp.nec.com> (raw)
In-Reply-To: <20140930141828.GA5161@redhat.com>

On 09/30/14 23:18, Mike Snitzer wrote:
> On Mon, Sep 29 2014 at  7:58pm -0400,
> Junichi Nomura <j-nomura@ce.jp.nec.com> wrote:
> 
>> On 09/26/14 01:12, Mike Snitzer wrote:
>>> On Thu, Sep 25 2014 at 11:57am -0400,
>>> Keith Busch <keith.busch@intel.com> wrote:
>>>> For my part, the goal was to change as little as possible to get basic
>>>> blk-mq support working safely without regressing, and performance is
>>>> not even on my radar yet. I purposefully did not try to understand the
>>>> existing design well enough to propose re-arching. If we can address the
>>>> 'request' life cycle management duality issue, would this be acceptable
>>>> as a stopgap for blk-mq support?
>>>
>>> We can ignore my desire to cleanup existing request-based DM's bio
>>> cloning for now.  And yes, resolving the duality issue would need to
>>> happen.  But your proposed change still has the issue of no longer using
>>> a dedicated mempool per rq-based DM device to allocate requests from.
>>> If we were to do that I'm pretty sure this new dm.c:dm_get_request()
>>> wrapper would need to call blk_get_request() with GFP_ATOMIC.
>>>
>>> Either GFP_ATOMIC or I think we _could_ relax to GFP_NOWAIT if and only
>>> if we were willing to explicitly disallow stacking request-based DM
>>> devices (which nothing uses at this point).  So I'd like to get Junichi
>>> and Alasdair's feedback on the implications.  Junichi and/or Alasdair?
>>
>> The problem with "stacking request-based DM devices" is
>> caused by shared mempool (i.e. the pool gets emptied by
>> upper layer and we can't make forward progress).
>> So it should be ok if request has per-device mempool
>> (I think it does.)
> 
> Current request-based DM provides a per-device mempool that all cloned
> requests are allocated from.  But Keith's approach to have map_rq call
> blk_get_request will no longer make use of that DM provided mempool.
> 
> But are you referring to the request_queue's use of a mempool that is
> initialized with blk_init_rl() in blk_init_allocated_queue()?

Yes.

>> However, using blk_get_request() in map function will
>> require more changes in the code as blk_get_request()
>> assumes interrupt-enabled context.
> 
> Ah yes, blk_get_request will unconditionally disable interrupts using
> spin_lock_irq.  Not yet looked at the implications though.

Actually, early implementation of request-based DM had tried to
use blk_get_request() by converting them to irqsave/irqrestore
variants. However, since (old, non-mq version of) blk_get_request
is designed to be called in process context, such a change
could have confused the interface.
As a result, current DM code implements pre-allocation of memory
and mapping separately.
I think blk-mq already does pre-allocation of requests internally
and mq version of blk_get_request is actually a mapping function
in this case.

So, I suspect DM functions for pre-allocation (clone_rq) and mapping
(map_request) are good place for containing the duality inside.

-- 
Jun'ichi Nomura, NEC Corporation

      reply	other threads:[~2014-09-30 23:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 17:03 [PATCH] dm-mpath: Work with blk multi-queue drivers Keith Busch
2014-09-24  9:02 ` Hannes Reinecke
2014-09-24 14:27   ` Christoph Hellwig
2014-09-24 14:52 ` Christoph Hellwig
2014-09-24 17:20   ` Keith Busch
2014-09-24 18:34     ` Mike Snitzer
2014-09-24 18:48       ` Mike Snitzer
2014-09-25  0:13         ` Mike Snitzer
2014-09-25 15:57           ` Keith Busch
2014-09-25 16:08             ` Christoph Hellwig
2014-09-25 16:12             ` Mike Snitzer
2014-09-29 23:58               ` Junichi Nomura
2014-09-30 14:18                 ` Mike Snitzer
2014-09-30 23:43                   ` Junichi 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=542B4033.30001@ce.jp.nec.com \
    --to=j-nomura@ce.jp.nec.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=keith.busch@intel.com \
    --cc=snitzer@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