Re: [PATCH v6 3/3] blk-cgroup: Optimize blkcg_rstat_flush()

From: Michal Koutný
Date: Wed Jun 08 2022 - 18:14:25 EST


On Wed, Jun 08, 2022 at 11:12:55PM +0200, Michal Koutný <mkoutny@xxxxxxxx> wrote:
> Wouldn't that mean submitting a bio from offlined blkcg?
> blkg_tryget_closest() should prevent that.

Self-correction -- no, forgot blkg_tryget_closest() gets any non-zero
reference, not just a live one (percpu_ref_tryget_live()), furthermore,
I can see that offlined blkcg may still issue writeback bios for
instance.

> > I guess one possible solution may be to abandon the llist and revert
> > back to list iteration when offline. I need to think a bit more about
> > that.

Since blkcg stats are only used for io.stat of an online blkcg, the
update may be skipped on an offlined blkcg. (Which of course breaks when
something starts to depend on the stats of an offlined blkcg.)

Michal