Linux Device Mapper development
 help / color / mirror / Atom feed
From: Joseph Qi <jiangqi903@gmail.com>
To: Mike Snitzer <snitzer@redhat.com>
Cc: 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: Tue, 21 Nov 2017 09:01:42 +0800	[thread overview]
Message-ID: <548580f7-72d8-ac31-171a-95f9cdcf6ddc@gmail.com> (raw)
In-Reply-To: <CAMM=eLes8Z05HseDYjt+S3HC7jvfyREZrRqGBbTzxEfy8KHEEA@mail.gmail.com>

Hi Mike,

On 17/11/21 05:02, 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?
> 
Since this is io.low specifically, I don't want the change in device
mapper layer. But I do agree with you that I have to cc dm-devel as
well. Sorry for missing that.

> 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.
> 
Thanks for your advice. I will update and resend it.

Thanks,
Joseph

>> 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.
> 
> Mike
> 

      parent reply	other threads:[~2017-11-21  1:01 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
2017-11-21  1:08     ` Mike Snitzer
2017-11-21  1:01   ` Joseph Qi [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=548580f7-72d8-ac31-171a-95f9cdcf6ddc@gmail.com \
    --to=jiangqi903@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.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