* [PATCH v3] don't forget to call pd_online_fn when activate policy
@ 2017-03-11 3:46 Zhou Chengming
2017-03-11 22:25 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Zhou Chengming @ 2017-03-11 3:46 UTC (permalink / raw)
To: axboe; +Cc: linux-block, linux-kernel, miaoxie, zhouchengming1
When we activate policy on the request_queue, we will create policy_date
for all the existing blkgs of the request_queue, so we should call
pd_init_fn() and pd_online_fn() on these newly created policy_data.
Signed-off-by: Zhou Chengming <zhouchengming1@huawei.com>
---
block/blk-cgroup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 8ba0af7..1eba1d2 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1254,6 +1254,12 @@ int blkcg_activate_policy(struct request_queue *q,
pd->plid = pol->plid;
if (pol->pd_init_fn)
pol->pd_init_fn(pd);
+
+ if (pol->pd_online_fn) {
+ spin_lock(&blkg->blkcg->lock);
+ pol->pd_online_fn(pd);
+ spin_unlock(&blkg->blkcg->lock);
+ }
}
__set_bit(pol->plid, q->blkcg_pols);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] don't forget to call pd_online_fn when activate policy
2017-03-11 3:46 [PATCH v3] don't forget to call pd_online_fn when activate policy Zhou Chengming
@ 2017-03-11 22:25 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-03-11 22:25 UTC (permalink / raw)
To: Zhou Chengming; +Cc: linux-block, linux-kernel, miaoxie
On 03/10/2017 08:46 PM, Zhou Chengming wrote:
> When we activate policy on the request_queue, we will create policy_date
> for all the existing blkgs of the request_queue, so we should call
> pd_init_fn() and pd_online_fn() on these newly created policy_data.
I'm not looking at this until you tell me that you have runtime
tested it. I'm assuming you originally ran into some issue
with the lack of calling pd_online_fn?
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-11 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-11 3:46 [PATCH v3] don't forget to call pd_online_fn when activate policy Zhou Chengming
2017-03-11 22:25 ` Jens Axboe
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.