[dm-devel] [PATCH v2 2/2] blk-throttle: fix wrong initialization in case of dm device

Joseph Qi jiangqi903 at gmail.com
Tue Nov 21 01:01:42 UTC 2017


Hi Mike,

On 17/11/21 05:02, Mike Snitzer wrote:
> On Sun, Nov 19, 2017 at 9:00 PM, Joseph Qi <jiangqi903 at gmail.com> wrote:
>> From: Joseph Qi <qijiang.qj at 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 at 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
> 




More information about the dm-devel mailing list