在 2026/8/18 15:06, Yu Kuai 写道:
> A bio currently stores and pins a queue-local blkg. This forces bio
> association and remap paths to look up or create a blkg even when no
> blkcg policy will use the bio, and ties the stored state to the current
> block device.
> 
> Store and reference the queue-independent blkcg in the bio instead. Add
> helpers that lazily look up or create the queue-local blkg when a policy
> needs it, and pin the result until the bio changes devices or releases
> its cgroup state.
> 
> If blkg creation fails while walking down the hierarchy, use the closest
> available ancestor and update the bio's blkcg association before recording
> the blkg reference. This keeps later CSS ID hash lookups matched with the
> pinned blkg.
> 
> Keep lookup-only users from creating missing blkgs. A pinned blkg remains
> in the queue hash until the bio drops its reference, so allow the bio to
> recover it from the hash after the blkg starts dying. Rename the bio
> association helpers to describe the blkcg state they now store.

Reviewed-by: Tao Cui <[email protected]>


Reply via email to