Re: [RFC PATCH v1 2/3] blk-cgroup: store blkcg in bio instead of blkg

Christoph Hellwig <[email protected]> Tue, 4 Aug 2026 17:47:21 +0200
Newsgroups gmane.linux.kernel.virtualization,gmane.linux.kernel.cgroups,gmane.linux.documentation,gmane.linux.kernel,gmane.linux.block,gmane.linux.kernel.bcache.devel,gmane.linux.raid,gmane.linux.file-systems,gmane.linux.kernel.mm
Message-ID <[email protected]>
On Tue, Aug 04, 2026 at 11:30:55PM +0800, yu kuai wrote:
> The problem here is that remove a cgroup can also remove the blkg from radix tree,
> even through it still has active refcounts. I think this can be fixed by checking
> the cgroup online_pin first, if it's zero, we can search the blkg from the
> request_queue blkg list, where blkg will not be removed until blkg_free_workfn().
> What's better, if we can convert the blkg list to hash table with key as blk-cgroup,
> it will be much better as we can lookup from this table instead of blkcg radix tree.

Yes, I think you can really easily do that with the rhashtable.