Re: [RFC PATCH v2 1/8] block: associate blkg in submit_bio instead of bio_set_dev

Christoph Hellwig <[email protected]> Wed, 29 Jul 2026 10:35:51 +0200
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-block
Message-ID <[email protected]>
On Wed, Jul 29, 2026 at 04:28:10PM +0800, yu kuai wrote:
> the blkg slow path radix tree lookup should be fine, because when we enable blkcg policies,
> it's expected performance should already be affected.

Note that eventually we need to migrate everyone off the radix-tree
as we plan to remove it.  And a hash table seems like a better
data structure than the radix-tree/xarray anyway.

> The only problem I see is rq_qos_merge(), where bi_blkg is deference with elevator spinlock
> held. However, I think this can be avoided as well, we can only do fast path blkg lookup, and
> skip merge if blkg do not exist, as we only require same blkcg bio merge, there is no IO to merge
> if this bio is the first blkcg bio.

> 
> If you agree, I'll start to cook a new pre-set to convert bi_blkg to bi_blkcg, and then convert
> queuelock to blkcg_mutex.

Yes, I'd love to see that if it works out.