mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] blk-cgroup: fix missing pd_online_fn() while activating policy
@ 2023-01-03 11:28 Yu Kuai
  2023-01-04 15:12 ` Michal Koutný
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Yu Kuai @ 2023-01-03 11:28 UTC (permalink / raw)
  To: tj, josef, axboe
  Cc: cgroups, linux-block, linux-kernel, yukuai3, yukuai1, yi.zhang,
	yangerkun

From: Yu Kuai <yukuai3@huawei.com>

If the policy defines pd_online_fn(), it should be called after
pd_init_fn(), like blkg_create().

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 block/blk-cgroup.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index ce6a2b7d3dfb..4c94a6560f62 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1455,6 +1455,10 @@ int blkcg_activate_policy(struct request_queue *q,
 		list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)
 			pol->pd_init_fn(blkg->pd[pol->plid]);
 
+	if (pol->pd_online_fn)
+		list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)
+			pol->pd_online_fn(blkg->pd[pol->plid]);
+
 	__set_bit(pol->plid, q->blkcg_pols);
 	ret = 0;
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-01-17  2:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-03 11:28 [PATCH] blk-cgroup: fix missing pd_online_fn() while activating policy Yu Kuai
2023-01-04 15:12 ` Michal Koutný
2023-01-05  1:43   ` Yu Kuai
2023-01-05 10:45     ` Michal Koutný
2023-01-05 13:52       ` Yu Kuai
2023-01-05 16:59         ` Tejun Heo
2023-01-05 17:00 ` Tejun Heo
2023-01-17  1:01 ` Yu Kuai
2023-01-17  2:04 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®