All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	Bart Van Assche <Bart.VanAssche@wdc.com>,
	linux-block <linux-block@vger.kernel.org>,
	"open list:DEVICE-MAPPER (LVM)" <dm-devel@redhat.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [for-4.16 PATCH v2 2/3] block: cope with gendisk's 'queue' being added later
Date: Wed, 10 Jan 2018 09:20:19 -0500	[thread overview]
Message-ID: <20180110142019.GB23410@redhat.com> (raw)
In-Reply-To: <CACVXFVPGesRgLCShzLkXYw+fbefPMLEEqc05Xa_w3qiXqrDFvA@mail.gmail.com>

On Wed, Jan 10 2018 at  2:55am -0500,
Ming Lei <tom.leiming@gmail.com> wrote:

> On Wed, Jan 10, 2018 at 12:21 PM, Mike Snitzer <snitzer@redhat.com> wrote:
> > On Tue, Jan 09 2018 at 10:46pm -0500,
> > Ming Lei <tom.leiming@gmail.com> wrote:
> >
> >> Another related issue is that blk-mq debugfs can't work yet for dm-mpath.
> >
> > Not sure how that is a related issue to this thread.
> > But can you expand on that?  I'm not familiar with "blk-mq debugfs".
> > Any pointer to code that activates it?  Could be that my changes make it
> > work now...
> 
> Hi,
> 
> blk_mq_debugfs_register() is called in blk_register_queue() from add_disk(),
> and blk_mq_debugfs_register() need queue's information to setup mq debugfs
> stuff.
> 
> But your patch does fix this issue, cool!

Great, thought it might.
 
> >> So I am just wondering if it is possible to follow the usual way to add disk
> >> after setting up queue for DM? If it is possible, it may avoid lots of trouble
> >> for us.
> >
> > As I explained in the header (quoted above actually) it is _not_
> > possible.  It is the gendisk that enables the device stack to be
> > constructed (at least how DM's stacking is currently implemented with
> > bd_link_disk_holder() and taking references on devices found in a DM
> > device's table).  And from that gendisk I can then walk the devices to
> > establish the request_queue as needed, its stacked limits, etc.
> >
> > The approach I've taken in these patches is the closest I've gotten to
> > make DM _much_ more sane about how its request_queue is established.
> > But its still off the beaten path due to needing "block: cope with
> > gendisk's 'queue' being added later".
> 
> OK, thanks for your explanation.
> 
> After taking close look at your patches, I think this approach is clean.
> But there are still corner cases which need to be addressed:
> 
> 1) in the following disk attributes, queue is referenced, so we have
> to add check in their show/store operations since the attributes
> are shown up just after disk is added.
> 
>      disk_alignment_offset_show
>      disk_discard_alignment_show
>      part_timeout_show/part_timeout_store
> 
> 2) same issue on /proc/diskstats: see diskstats_show()
> 
> 3) in IO path, looks we already checked disk->queue in
> generic_make_request_checks(), so it should be fine, and you set
> disk->queue after the queue is fully initialized in the 3rd patch.

I'll work through these and see what I can do.

Will likely deal with each independent of the 2/3 patch (otherwise
if I just keep folding changes in to the original patch review will get
too hard).

So hopefully I'll have a v3 to share later today.

Thanks,
Mike

  reply	other threads:[~2018-01-10 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  2:41 [for-4.16 PATCH v2 0/3] block: some genhd changes Mike Snitzer
2018-01-10  2:41 ` [for-4.16 PATCH v2 1/3] block: only bdi_unregister() in del_gendisk() if !GENHD_FL_HIDDEN Mike Snitzer
2018-01-10  4:35   ` Mike Snitzer
2018-01-10  8:31   ` Christoph Hellwig
2018-01-10  2:41 ` [for-4.16 PATCH v2 2/3] block: cope with gendisk's 'queue' being added later Mike Snitzer
2018-01-10  3:46   ` [dm-devel] " Ming Lei
2018-01-10  4:21     ` Mike Snitzer
2018-01-10  7:55       ` Ming Lei
2018-01-10 14:20         ` Mike Snitzer [this message]
2018-01-10  8:32   ` Christoph Hellwig
2018-01-10 12:01     ` Hannes Reinecke
2018-01-10  2:41 ` [for-4.16 PATCH v2 3/3] dm: fix awkward request_queue initialization Mike Snitzer

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=20180110142019.GB23410@redhat.com \
    --to=snitzer@redhat.com \
    --cc=Bart.VanAssche@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=tom.leiming@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.