Linux Device Mapper development
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Mike Snitzer <snitzer@redhat.com>
Cc: Joseph Qi <jiangqi903@gmail.com>, Jens Axboe <axboe@kernel.dk>,
	Shaohua Li <shli@fb.com>,
	linux-block <linux-block@vger.kernel.org>,
	qijiang.qj@alibaba-inc.com,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH v2 2/2] blk-throttle: fix wrong initialization in case of dm device
Date: Mon, 20 Nov 2017 13:23:19 -0800	[thread overview]
Message-ID: <20171120212319.3rxkbcdpxglfa565@kernel.org> (raw)
In-Reply-To: <CAMM=eLes8Z05HseDYjt+S3HC7jvfyREZrRqGBbTzxEfy8KHEEA@mail.gmail.com>

On Mon, Nov 20, 2017 at 04:02:03PM -0500, Mike Snitzer wrote:
> On Sun, Nov 19, 2017 at 9:00 PM, Joseph Qi <jiangqi903@gmail.com> wrote:
> > From: Joseph Qi <qijiang.qj@alibaba-inc.com>
> >
> > dm device set QUEUE_FLAG_NONROT in resume, which is after register
> > queue. That is to mean, the previous initialization in
> > blk_throtl_register_queue is wrong in this case.
> > Fix it by checking and then updating the info during root tg
> > initialization as we don't have a better choice.
> 
> Given DM motivated this change, curious why you didn't send this to dm-devel?
> 
> In any case, not sure why you need to reference "resume".  Very few
> people will appreciate that detail.
> 
> Better to just say: DM device sets QUEUE_FLAG_NONROT after the queue
> is registered.
> 
> > Signed-off-by: Joseph Qi <qijiang.qj@alibaba-inc.com>
> > ---
> >  block/blk-throttle.c | 17 +++++++++++++++++
> >  1 file changed, 17 insertions(+)
> >
> > diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> > index bf52035..6d6b220 100644
> > --- a/block/blk-throttle.c
> > +++ b/block/blk-throttle.c
> > @@ -541,6 +541,23 @@ static void throtl_pd_init(struct blkg_policy_data *pd)
> >         if (cgroup_subsys_on_dfl(io_cgrp_subsys) && blkg->parent)
> >                 sq->parent_sq = &blkg_to_tg(blkg->parent)->service_queue;
> >         tg->td = td;
> > +
> > +       /*
> > +        * dm device set QUEUE_FLAG_NONROT in resume, which is after resister
> > +        * queue, so the previous initialization is wrong in this case. Check
> > +        * and update it here.
> > +        */
> 
> typo: s/resister/register/
> But again, best to say:
> DM device sets QUEUE_FLAG_NONROT after the queue is registered, ...
> 
> Also, an alternative to your patch would be to have DM's
> dm_table_set_restrictions() call a blk-throttle function to setup
> blk-throttle after it is done setting queue flags?
> Saves all other drivers from having to run this 2 stage initialization
> code.. just a thought.

Though the patch is a workaround, I'd prefer limiting the code into
blk-throttle itself. Populating it to drivers is a layer violation to me. The
initialization only runs once, so I think it's ok.

Thanks,
Shaohua

  reply	other threads:[~2017-11-20 21:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <241a6fbe-f2d2-3d11-ba45-afc5b02de9c2@gmail.com>
2017-11-20 21:02 ` [PATCH v2 2/2] blk-throttle: fix wrong initialization in case of dm device Mike Snitzer
2017-11-20 21:23   ` Shaohua Li [this message]
2017-11-21  1:08     ` Mike Snitzer
2017-11-21  1:01   ` Joseph Qi

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=20171120212319.3rxkbcdpxglfa565@kernel.org \
    --to=shli@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=jiangqi903@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=qijiang.qj@alibaba-inc.com \
    --cc=shli@fb.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