mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
blkcg: rename blkcg->cgwb_refcnt to ->online_pin and always use it
blkcg->cgwb_refcnt is used to delay blkcg offlining so that blkgs don't get offlined while there are active cgwbs on them. However, it ends up making offlining unordered sometimes causing parents to be offlined before children. To fix it, we want child blkcgs to pin the parents' online states turning the refcnt into a more generic online pinning mechanism. In prepartion, * blkcg->cgwb_refcnt -> blkcg->online_pin * blkcg_cgwb_get/put() -> blkcg_pin/unpin_online() * Take them out of CONFIG_CGROUP_WRITEBACK Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -491,8 +491,8 @@ static void cgwb_release_workfn(struct work_struct *work)
|
||||
css_put(wb->blkcg_css);
|
||||
mutex_unlock(&wb->bdi->cgwb_release_mutex);
|
||||
|
||||
/* triggers blkg destruction if cgwb_refcnt becomes zero */
|
||||
blkcg_cgwb_put(blkcg);
|
||||
/* triggers blkg destruction if no online users left */
|
||||
blkcg_unpin_online(blkcg);
|
||||
|
||||
fprop_local_destroy_percpu(&wb->memcg_completions);
|
||||
percpu_ref_exit(&wb->refcnt);
|
||||
@@ -592,7 +592,7 @@ static int cgwb_create(struct backing_dev_info *bdi,
|
||||
list_add_tail_rcu(&wb->bdi_node, &bdi->wb_list);
|
||||
list_add(&wb->memcg_node, memcg_cgwb_list);
|
||||
list_add(&wb->blkcg_node, blkcg_cgwb_list);
|
||||
blkcg_cgwb_get(blkcg);
|
||||
blkcg_pin_online(blkcg);
|
||||
css_get(memcg_css);
|
||||
css_get(blkcg_css);
|
||||
}
|
||||
|
Reference in New Issue
Block a user