Re: [PATCH] block, bfq: release cgroup stats with bfq_group
From: Jens Axboe
Date: Mon Jun 01 2026 - 15:06:15 EST
On Mon, 01 Jun 2026 14:15:02 +0800, Yu Kuai wrote:
> BFQ cgroup stats contain percpu counters embedded in struct bfq_group,
> but the old free path destroys them from bfq_pd_free(), which is tied
> to blkg policy-data teardown.
>
> That is not the same lifetime as struct bfq_group. BFQ pins bfq_group
> while bfq_queue entities refer to it, so bfq_pd_free() can drop the
> policy-data reference while other bfq_group references still exist. The
> following blkcg change also defers policy-data release through RCU and
> leaves BFQ to run the final bfqg_put() from an RCU callback. For that
> conversion, stats teardown must belong to the last bfq_group put, not to
> policy-data teardown.
>
> [...]
Applied, thanks!
[1/1] block, bfq: release cgroup stats with bfq_group
commit: 9e1183a465e4a912cce1e4b389d0d7394c127eb5
Best regards,
--
Jens Axboe