diff options
| author | Yu Kuai <yukuai@fygo.io> | 2026-06-08 11:42:42 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-06-24 06:37:54 -0600 |
| commit | 25656304dabd26198ec69460c594a19d086ef099 (patch) | |
| tree | e7c75bef914353368f3b42361157fa0617460f65 /include/linux/workqueue_api.h | |
| parent | 8a901e629ef874c6bc360343008d779a820140db (diff) | |
blk-cgroup: protect iterating blkgs with blkcg->lock in blkcg_print_stat()
blkcg_print_one_stat() will be called for each blkg:
- access blkg->iostat, which is freed from rcu callback
blkg_free_workfn();
- access policy data from pd_stat_fn(), which is freed from
pd_free_fn(), while pd_free_fn() can be called by removing blkcg or
deactivating policy;
Take blkcg->lock while iterating so the blkgs stay online and both
blkg->iostat and policy data for activated policies stay valid. Use
irq-safe locking because blkcg->lock can be nested under q->queue_lock,
which is used from IRQ completion paths.
Prepare to convert protecting blkgs from request_queue with mutex.
Signed-off-by: Yu Kuai <yukuai@fygo.io>
Link: https://patch.msgid.link/05799877e720dcd300e2ddd4625e8e162959d7cc.1780621988.git.yukuai@fygo.io
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/workqueue_api.h')
0 files changed, 0 insertions, 0 deletions
