lkml.org 
[lkml]   [2018]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2 1/2] blk-mq: init hctx sched after update ctx and hctx mapping
From
Date
Hi Ming

On 08/20/2018 10:24 AM, Ming Lei wrote:
>> The code path is:
>>
>> elevator_release
>> -> elevator_put(e->type)
>> -> module_put(e->elevator_owner)
>>
>> In normal elevator switch path, elevator_get will hold a reference counter of the
>> elevator_owner.
>> In this patch set, the elevator_type is saved directly. To prevent the io scheduler module
>> is removed, we need to hold a reference of the module.
> Yeah, I agree that the module reference need to be held, but it need to be
> released too.
>
> My concern is that this introduced getting module reference in your patch
> isn't released. The module reference is a counter too, so the get and
> put operation should be matched.

elevator_switch_mq
-> elevator_exit
it will put a reference count of the elevator_queue associated with the request_queue.
and the elevator_release will be invoked when the reference count of elevator_queue->kobj reaches zero.
elevator_release will put the reference count of the io scheduler module.

the elevator_queue structure will be allocated and freed every time when we switch io scheduler.
so the elevator_release will always be invoked.

This is the put ref corresponding to the get one in this patch.

Thanks
Jianchao

\
 
 \ /
  Last update: 2018-08-20 05:59    [W:0.075 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site